sqlboiler
Generate a Go ORM tailored to your database schema.
What is sqlboiler?
Generate a Go ORM tailored to your database schema.
Overview of sqlboiler
What it is
SQLBoiler is a tool to generate a Go ORM tailored to your database schema. It is a “database-first” ORM, meaning you must first create your database schema before generating the code. The package is currently in maintenance mode: it generally does not accept new features, but does accept bug fixes and version compatibility changes provided by the community. Maintainers usually do not resolve reported issues, and community members are encouraged to help each other. Alternatives include Bob (directly inspired by SQLBoiler) and sqlc (a type-safe code generator from SQL).
Key features
- Full model generation from an existing database schema - Strongly typed querying with no need for interface{} - Hooks (Before/After Create, Select, Update, Delete, Upsert)
- Automatic CreatedAt/UpdatedAt and DeletedAt fields - Eager loading (recursive) of relationships - Raw SQL fallback and transactions support - Supports PostgreSQL, MySQL, MSSQLServer 2012+, SQLite3, and CockroachDB (via third-party driver)
- Table and column whitelist/blacklist, custom struct tags, enum types, and database views
Use cases
- Generating a Go ORM from an existing legacy database schema - Replacing repetitive
database/sqlcode with a type-safe, generated ORM - Projects that require a database-first workflow with migration tools like sql-migrate - Applications needing high-performance, reflect-free ORM code with strong relationship support
Getting started
See the repository README for detailed installation, configuration, and generation instructions.
License and pricing
The license is not stated in the provided metadata or README. The package is listed as open source.
Based on the project's public README and repository metadata.