dochang / sqlconv

A Go library converts between Go values and SQL values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sqlconv

CI CircleCI codecov Go Reference

sqlconv is a Go library converts between Go values and SQL values.

Installation

go get github.com/dochang/sqlconv

Usage

Currently, sqlconv provides a interface ScannerConverter, which is used to convert SQL values to Go values.

type ScannerConverter interface {
	ScanConvert(dest, src any) error
}

ScanConvert converts SQL value src to Go value, then writes the Go value into dest.

A predefined variable DefaultScannerConverter converts SQL values based on the rules defined by the function "database/sql".convertAssign.

About

A Go library converts between Go values and SQL values

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%