// the find
aarondl/sqlboiler
Generate a Go ORM tailored to your database schema.
SQLBoiler generates a Go ORM from your existing database schema — you write the migrations, it writes the Go models. Database-first approach means your Go types match your actual columns, not the other way around. Worth knowing upfront: the README opens with a maintenance-mode notice and points you toward Bob (by a former SQLBoiler maintainer) as the actively developed successor.
Generated code is just Go — no reflect magic at runtime, so query paths are fast and debuggable by reading the output. Type safety is genuine: column types map directly to Go types including a solid null package, so you catch schema mismatches at compile time rather than at 2am. The query mod system is expressive without being a DSL — composing Where, InnerJoin, Load for eager loading reads like it should. Relationship handling is a first-class feature with proper eager loading, set operations, and configurable aliases for when your FK names don't match your domain language.
Maintenance mode is not a minor caveat — bug fixes and compatibility patches only, no new features, maintainers won't resolve issues. Multi-column foreign keys are explicitly unsupported, which is a real schema constraint that will bite anyone with a legacy database. The boil.Infer zero-value behavior for inserts is a subtle trap: setting a bool to false won't insert it because false is the zero value, requiring explicit whitelists that are easy to forget. Cross-schema queries aren't supported, so if your Postgres database uses multiple schemas for organization you're stuck.