sqlboiler is a database-first ORM generator for Go that analyzes an existing database schema to produce strongly typed structures and query helpers. It functions as a schema-driven code generator, transforming database tables and relationships into executable Go source code.
The project distinguishes itself through a type-safe query builder that uses chainable modifiers to construct SQL statements, eliminating the need for raw string concatenation. It utilizes customizable text templates to generate source code, allowing for the aliasing of schema entities and the creation of custom templates based on database metadata.
The system covers a broad range of relational data mapping capabilities, including foreign key relationship mapping, batch-based eager loading to prevent N+1 performance issues, and type-safe mapping for database enums. It also provides automation for CRUD operations, including support for upserts, soft deletes using timestamps, and lifecycle hooks that trigger before or after database operations.