A Go SQL toolkit with a query builder, ORM, and code generation for PostgreSQL, MySQL, and SQLite.
Bob is a Go SQL access toolkit that combines a query builder, ORM, and code generation to simplify database interactions. It solves the problem of writing type-safe, maintainable SQL queries in Go by generating models and factories from your database schema. It supports PostgreSQL, MySQL, and SQLite with a focus on correctness and developer convenience.
Go developers building applications that require robust, type-safe database interactions, especially those who prefer code generation over runtime reflection. It's suitable for projects using PostgreSQL, MySQL, or SQLite.
Developers choose Bob for its progressive adoption path, from raw SQL to fully generated type-safe queries, and its philosophy of correctness without magic. It offers a comprehensive alternative to ORMs like GORM or Ent by combining a query builder, ORM, and factory generation in one toolkit.
SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows starting with raw SQL and gradually integrating type-safe models and factories, as outlined in the layered approach from query builder to full ORM generation.
Generates Go models and query mods from the database schema, ensuring compile-time correctness similar to tools like sqlc and SQLBoiler, reducing runtime errors.
Factory generation inspired by Ruby's FactoryBot simplifies test data creation for relational data, as demonstrated in examples for creating comments with associated posts and users.
Offers hand-crafted, dialect-specific builders for PostgreSQL, MySQL, and SQLite that support any query type without invalid constructions, as highlighted in the layer descriptions.
Requires running generators whenever the database schema changes, adding steps to development and deployment workflows, which can slow down iteration compared to runtime ORMs.
Configuration for model and factory generation is needed upfront, making it more complex to start than drop-in ORMs like GORM, especially for teams new to code generation.
As a newer project, Bob has a smaller community and fewer third-party integrations compared to established alternatives like GORM or Ent, which could impact support and resources.