sqlh
https://github.com/nofeaturesonlybugs/sqlh
Powerful struct scanning for Go's database/sql and other compatible interfaces.
sqlh
is easy to use because it lives very close todatabase/sql
. The primary goal ofsqlh
is to work with and facilitate usingdatabase/sql
without replacing or hijacking it. When usingsqlh
you manage your*sql.DB
or create*sql.Tx
as you normally would and pass those as arguments to functions insqlh
when scanning or persisting models;sqlh
then works within the confines of what you gave it.
When accepting arguments that work directly with the database (
*sql.DB
or*sql.Tx
)sqlh
accepts them as interfaces. This meanssqlh
may work with other database packages that define their own types as long as they kept a method set similar todatabase/sql
.