sqlx is a library which provides a set of extensions on go's standard database/sql library. The sqlx versions of sql.DB, sql.TX, sql.Stmt, et al. all leave the underlying interfaces untouched, so that their interfaces are a superset on the standard ones. This makes it relatively painless to integrate existing codebases using database/sql with sqlx.
sqlx is a library which provides a set of extensions on go's standard database/sql
library. The sqlx versions of sql.DB
, sql.TX
, sql.Stmt
, et al. all leave the underlying interfaces untouched, so that their interfaces are a superset on the standard ones. This makes it relatively painless to integrate existing codebases using database/sql
with sqlx.
Major additional concepts are:
- Marshal rows into structs (with embedded struct support), maps, and slices
- Named parameter support including prepared statements
Get
andSelect
to go quickly from query to struct/slice- LoadFile for executing statements from a file
There is now some fairly comprehensive documentation for sqlx. You can also read the usage below for a quick sample on how sqlx works, or check out the API documentation on godoc.