SQLair

SQLair is a Go package and an extension to SQL that makes it easy to map between Go types and a SQL database.

With SQLair, once you’ve SQLair-proofed your types and SQLair-wrapped your database, you can jump straight to writing, parsing, and running queries against the database.

When interacting with a SQL database in Go, mapping between the database tables and the Go types is an issue. Convenience layers can be either too little (e.g., database/sql, where you can write any SQL you want, but you have to manually iterate over each row) or too much (e.g., Object-Relational Mapping (ORM) libraries where you get automatic mapping but lose the ability to write the SQL). With SQLair you get just the right balance – automatic mapping plus the ability to write any SQL you want.

If you’re looking to streamline your Go game, go get SQLair today.

Note

The project is pre-release and there may still be major changes to the API.

In this documentation

Get started with a hands-on introduction to SQLair

Step-by-step guides covering key operations and common tasks

Technical information about SQLair

Security information about SQLair

Project and community

SQLair is an open source project that warmly welcomes community projects, contributions, suggestions, fixes and constructive feedback. We welcome any improvements to the documentation or SQLair itself. Please see our contributing guide if you would like to get involved!

The SQLair project is currently under the care of the Juju team at Canonical. If you have any questions or would just like to say hi you can find us on the Charmhub Discourse Forum. Just mention SQLair in the subject of your post, and we will see it.

If you have any issues or bugs to raise, please see our GitHub issues page.