// the find
stephenafamo/bob
SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite
Bob is a layered SQL toolkit for Go that spans raw query building, type-safe ORM code generation, test factories, and sqlc-style typed query generation — all from your actual database schema. It targets developers who want more than squirrel but less magic than GORM, and it covers Postgres, MySQL, and SQLite with per-dialect hand-crafted builders rather than a lowest-common-denominator abstraction.
The progressive adoption story is genuinely well designed: you can start with the fluent query builder and add codegen later without rewriting anything. The factory generator is the standout feature — getting FactoryBot-style test helpers for free from your schema eliminates a huge category of test boilerplate that most Go projects just give up on. Per-dialect query builders mean Postgres-specific features (MERGE, RETURNING, CTEs, ON CONFLICT) are first-class rather than awkward workarounds. The sqlc-style query codegen layer on top of the ORM models is a smart combination: hand-write SQL where you need control, get type safety automatically.
At 1,734 stars it's still a small community — questions that fall outside the docs leave you reading source. The codegen approach means schema changes require a regenerate step, and the generated code volume can be substantial; teams without a solid codegen discipline in CI will drift. No async/streaming query support documented, which matters for large result sets. The four-layer mental model (builder → ORM gen → factory gen → query gen) is a real onboarding cliff for developers who just want to run a SELECT.