SQLair is a Go package and an extension to SQL that makes it easy to map between Go types and a SQL database.
Reading and writing to a database in Go can be hard. The solutions out there are
often either too prescriptive (e.g., Object-Relational Mapping (ORM) libraries
where you lose the ability to write your own SQL) or too basic (e.g.,
database/sql
, where you have to manually iterate over each row you get back
from the database).
SQLair fills the gap in the middle – automatic type mapping plus the ability to write any SQL you wish. Write your types directly into the query with SQLair expressions and SQLair will automatically map them to the query arguments and inject them with the query results.
If you’re looking to streamline your database game, go get
SQLair today.
- Maps database inputs and outputs to Go types
- Simple API
- Database agnostic
- Automatic statement caching
Get started with the SQLair tutorial.
See the documentation on Read the Docs and in the Go Package Reference.
See our CONTRIBUTING.md.