PackageTrack
Sign in Get early access

github.com/stephenafamo/bob

v0.50.0 #913 most downloaded on Go modules stephenafamo/bob

What this package is like to depend on

Last release 13 days ago

11 Aug 2026

Ships on a steady schedule

a new release about every 9 days

Most releases are documented

notes for 57 of 94 stable releases

1 version withdrawn

withdrawn after publishing

4 years old

329 releases · first in 2022

42 releases in the last 12 months

see the full history below

Release timeline

329 releases · Apr 2022 to Aug 2026
2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 329
  1. v0.50.0 11 Aug 2026
    Release notes

    Added

    • Generated dberrors packages now include generic and per-table check-constraint errors for PostgreSQL, matched by constraint name for pq and pgx drivers. (thanks @keithbro-imx)

    Changed

    • PostgreSQL single-column slice relationship loaders (<Parent>Slice.<Rel>) and batch counts (<Parent>Slice.LoadCount<Rel>) now de-duplicate the key array bound to = ANY($1) when the key column can contain duplicates (a non-unique foreign key). The array is only a semi-join filter, so query results are unchanged — a slice of 10,000 parents sharing 50 related rows now binds 50 keys instead of 10,000. Keys that are unique by construction (the parent's own primary key or a uniquely-constrained column) and key types not comparable with == keep the previous plain loop, decided at codegen time (#740). (thanks @sandonemaki)
    • Generated through-relationship loaders (Load<Rel>) no longer apply every query mod twice (once against a throwaway query to detect whether the user set columns, then again for real). The default columns are now added by a deferred bob.ModFunc during the single real application — the same pattern View.Query uses — and the join-key slice is pre-allocated to the parent slice length. Generated SQL is unchanged (#740). (thanks @sandonemaki)

    Fixed

    • Fixed the PostgreSQL code generator's query parser renumbering each reference to a repeated query parameter ($N) as a distinct argument (e.g. id = $1 OR parent_id = $1 generating $1/$2), which changed the meaning of the generated query mods. Repeated $N references now map to a single generated parameter (#745). (thanks @dmakushin)

    New Contributors

    Full Changelog: v0.49.0...v0.50.0

    Open source →
    Release notes

    Added

    • Generated dberrors packages now include generic and per-table check-constraint errors for PostgreSQL, matched by constraint name for pq and pgx drivers. (thanks @keithbro-imx)

    Changed

    • PostgreSQL single-column slice relationship loaders (<Parent>Slice.<Rel>) and batch counts (<Parent>Slice.LoadCount<Rel>) now de-duplicate the key array bound to = ANY($1) when the key column can contain duplicates (a non-unique foreign key). The array is only a semi-join filter, so query results are unchanged — a slice of 10,000 parents sharing 50 related rows now binds 50 keys instead of 10,000. Keys that are unique by construction (the parent's own primary key or a uniquely-constrained column) and key types not comparable with == keep the previous plain loop, decided at codegen time (#740). (thanks @sandonemaki)
    • Generated through-relationship loaders (Load<Rel>) no longer apply every query mod twice (once against a throwaway query to detect whether the user set columns, then again for real). The default columns are now added by a deferred bob.ModFunc during the single real application — the same pattern View.Query uses — and the join-key slice is pre-allocated to the parent slice length. Generated SQL is unchanged (#740). (thanks @sandonemaki)

    Fixed

    • Fixed the PostgreSQL code generator's query parser renumbering each reference to a repeated query parameter ($N) as a distinct argument (e.g. id = $1 OR parent_id = $1 generating $1/$2), which changed the meaning of the generated query mods. Repeated $N references now map to a single generated parameter (#745). (thanks @dmakushin)
    Open source →
  2. v0.49.1-0.20260804090146-1464858665b3 04 Aug 2026 pre-release

    Nothing published for this version

  3. v0.49.1-0.20260720163148-e48b781d0c86 20 Jul 2026 pre-release

    Nothing published for this version

  4. v0.49.1-0.20260720123524-96dafaa3dcf1 20 Jul 2026 pre-release

    Nothing published for this version

  5. v0.49.0 20 Jul 2026
    Release notes

    Added

    • Added bob.NextUniqueInt() for generating unique SQL alias suffixes (#719). (thanks @atzedus)
    • Code generation now emits a reflection-free scan.Mapper per table (<table>ScanMapper) that scans each result column directly into the struct field by index. The mapper is passed to the model constructor, so every query built from a model — Query(), relationship loaders, and Insert/Update/Delete with RETURNING — scans without the per-row reflection of scan.StructMapper. (thanks @sandonemaki)
    • Generated Where structs now include relationship filters under an R field (e.g. SelectWhere.Pilots.R.HasJets(filters ...bob.Mod[*dialect.SelectQuery])) that filter rows by the existence of related rows, using a correlated EXISTS subquery (semi-join) built from the schema's relationship definitions. The R namespace mirrors the model struct and keeps the filters from colliding with column names. Unlike filtering through SelectJoins, this does not multiply parent rows, so DISTINCT is not needed and Count()/LIMIT-based pagination stay correct (#722). (thanks @sandonemaki)

    Changed

    • NewViewx and NewTablex in the psql, mysql and sqlite dialects now take a scan.Mapper[T] argument used for all queries built from the view/table. Pass nil to keep the previous reflection-based scan.StructMapper behaviour. NewView/NewTable are unchanged. (thanks @sandonemaki)
    • JOIN a DISTINCT unnest(...) for composite-key relationship loaders & counts on PostgreSQL. (thanks @sandonemaki)

    Fixed

    • Fixed an unused type import (e.g. github.com/google/uuid) in generated models when the type is only referenced through optional wrapper expressions, such as m2m relationship helpers for a join table with a uuid column (#730).
    • Fixed the counts plugin's generated C field reusing the relation_tag struct tag, which collided with the relations R field and caused encoding/json to drop both fields when a real tag name was configured. The C field now uses a dedicated relation_tag_count config option (default "-"). (thanks @jacobmolby)
    • Fixed generated join alias suffixes using randInt(), which could produce negative values when maphash.Hash.Sum64() overflowed int64 (#719). Generated join mods now use bob.NextUniqueInt() instead. (thanks @atzedus)
    • Fixed orm.Query.Clone() dropping the Scanner, which made All/One/Cursor/Each on a cloned query panic with a nil pointer dereference. (thanks @sandonemaki)
    • Fixed column_order on * selectors in sql queries in postgres

    New Contributors

    Full Changelog: v0.48.0...v0.49.0

    Open source →
    Release notes

    Added

    • Added bob.NextUniqueInt() for generating unique SQL alias suffixes (#719). (thanks @atzedus)
    • Code generation now emits a reflection-free scan.Mapper per table (<table>ScanMapper) that scans each result column directly into the struct field by index. The mapper is passed to the model constructor, so every query built from a model — Query(), relationship loaders, and Insert/Update/Delete with RETURNING — scans without the per-row reflection of scan.StructMapper. (thanks @sandonemaki)
    • Generated Where structs now include relationship filters under an R field (e.g. SelectWhere.Pilots.R.HasJets(filters ...bob.Mod[*dialect.SelectQuery])) that filter rows by the existence of related rows, using a correlated EXISTS subquery (semi-join) built from the schema's relationship definitions. The R namespace mirrors the model struct and keeps the filters from colliding with column names. Unlike filtering through SelectJoins, this does not multiply parent rows, so DISTINCT is not needed and Count()/LIMIT-based pagination stay correct (#722). (thanks @sandonemaki)

    Changed

    • NewViewx and NewTablex in the psql, mysql and sqlite dialects now take a scan.Mapper[T] argument used for all queries built from the view/table. Pass nil to keep the previous reflection-based scan.StructMapper behaviour. NewView/NewTable are unchanged. (thanks @sandonemaki)
    • JOIN a DISTINCT unnest(...) for composite-key relationship loaders & counts on PostgreSQL. (thanks @sandonemaki)
    • Preload now shares a single related-struct instance between all parent rows with the same join key, instead of building an identical instance per parent row — the same semantics as ThenLoad. The emitted SQL is unchanged; construction, nested loader collection and mapping now run once per distinct related row, which significantly reduces time, allocations and retained memory on high-duplication workloads. Preloaded structs should be treated as read-only: code that mutates a preloaded struct and relies on each parent having its own copy must copy the struct first. (thanks @sandonemaki)

    Fixed

    • Fixed an unused type import (e.g. github.com/google/uuid) in generated models when the type is only referenced through optional wrapper expressions, such as m2m relationship helpers for a join table with a uuid column (#730).
    • Fixed the counts plugin's generated C field reusing the relation_tag struct tag, which collided with the relations R field and caused encoding/json to drop both fields when a real tag name was configured. The C field now uses a dedicated relation_tag_count config option (default "-"). (thanks @jacobmolby)
    • Fixed generated join alias suffixes using randInt(), which could produce negative values when maphash.Hash.Sum64() overflowed int64 (#719). Generated join mods now use bob.NextUniqueInt() instead. (thanks @atzedus)
    • Fixed orm.Query.Clone() dropping the Scanner, which made All/One/Cursor/Each on a cloned query panic with a nil pointer dereference. (thanks @sandonemaki)
    • Fixed column_order on * selectors in sql queries in postgres
    Open source →
  6. v0.48.1-0.20260720000131-2786e9cc4137 20 Jul 2026 pre-release

    Nothing published for this version

  7. v0.48.1-0.20260718081556-f17f6493445e 18 Jul 2026 pre-release

    Nothing published for this version

  8. v0.48.1-0.20260711000130-95f703bdc85a 11 Jul 2026 pre-release

    Nothing published for this version

  9. v0.48.0 26 Jun 2026
    Release notes

    Changed

    • PostgreSQL single-column relationship loaders — both the slice relationship query (<Parent>Slice.<Rel>) and the batch count method (<Parent>Slice.LoadCount<Rel>) — now filter related rows with col = ANY($1) instead of col IN (SELECT unnest($1)), so the query planner can use an index scan on the foreign key instead of a Seq Scan + Hash Semi Join. Composite-key relationships keep the existing IN (SELECT unnest(...)) form. (thanks @sandonemaki)

    Fixed

    • Fixed PostgreSQL generated query parsing for CTEs that use table functions in FROM (for example unnest(...) AS alias), which could incorrectly widen CTE spans and generate malformed query mods such as duplicated outer SELECT projections.

    Full Changelog: v0.47.0...v0.48.0

    Open source →
    Release notes

    Changed

    • PostgreSQL single-column relationship loaders — both the slice relationship query (<Parent>Slice.<Rel>) and the batch count method (<Parent>Slice.LoadCount<Rel>) — now filter related rows with col = ANY($1) instead of col IN (SELECT unnest($1)), so the query planner can use an index scan on the foreign key instead of a Seq Scan + Hash Semi Join. Composite-key relationships keep the existing IN (SELECT unnest(...)) form. (thanks @sandonemaki)

    Fixed

    • Fixed PostgreSQL generated query parsing for CTEs that use table functions in FROM (for example unnest(...) AS alias), which could incorrectly widen CTE spans and generate malformed query mods such as duplicated outer SELECT projections.
    Open source →
  10. v0.47.1-0.20260626200259-bf3b99b5ce8f 26 Jun 2026 pre-release

    Nothing published for this version

  11. v0.47.1-0.20260622201228-35d9c14c4688 22 Jun 2026 pre-release

    Nothing published for this version

  12. v0.47.0 22 Jun 2026
    Release notes

    Added

    • Added column_order config option (shared across all drivers). Set to "name" to sort generated model columns alphabetically, producing deterministic output regardless of the order migrations were applied to the database. Defaults to "ordinal" (previous behaviour: database physical column order). (thanks @cbarber)

    Changed

    • Change the closure in RunInTx to pass bob.Transaction instead of bob.Executor

    New Contributors

    Full Changelog: v0.46.0...v0.47.0

    Open source →
    Release notes

    Added

    • Added column_order config option (shared across all drivers). Set to "name" to sort generated model columns alphabetically, producing deterministic output regardless of the order migrations were applied to the database. Defaults to "ordinal" (previous behaviour: database physical column order). (thanks @cbarber)

    Changed

    • Change the closure in RunInTx to pass bob.Transaction instead of bob.Executor
    Open source →
  13. v0.46.1-0.20260611114504-576a98a33332 11 Jun 2026 pre-release

    Nothing published for this version

  14. v0.46.0 11 Jun 2026
    Release notes

    Added

    • With() on generated queries as a more ergonomic method to add mods on top of generated queries (thanks @daddz)
    • Added Asc()/Desc()/... helpers to sm.OrderCombined for PostgreSQL/MySQL (thanks @daddz)
    • Added SQLite um.SetCols(columns...) and im.SetCols(columns...) for tuple assignment in UPDATE ... SET and ON CONFLICT DO UPDATE SET (.ToExprs(...), .ToRow(...), .ToQuery(...)). SQLite renders (cols) = (exprs...); PostgreSQL ToRow still emits ROW (...). MySQL does not support tuple assignment — use multiple SetCol calls. (thanks @atzedus)

    Fixed

    • Fixed generated Setter.Apply wrapping all insert values in a single ExpressionFunc, which prevented BeforeInsertHooks and query mods from modifying individual column values via q.Values.Vals[row][columnIndex]. Base and SQLite codegen templates now emit one expression per column (MySQL already did). Generated SQL is unchanged. (thanks @atzedus)
    • Fixed generated query mods for combined UNION/INTERSECT/EXCEPT queries dropping or misrouting the first operand's ORDER BY/LIMIT/OFFSET into the combined-result clauses. (thanks @daddz)
    • Fixed PostgreSQL um / dm standalone join mods (InnerJoin, LeftJoin, etc.) applied before um.From(...) / dm.Using(...): the join is now preserved and attached to the next FROM / USING from_item instead of being dropped. (thanks @atzedus)
    • Fixed/extended PostgreSQL sm.From(...): it now accepts variadic join chains (sm.From(table, joins...)), and inline joins are merged with already attached standalone joins when replacing the primary FROM source. (thanks @atzedus)

    Changed

    • Moved PostgreSQL SetCols tuple-assignment builder from dialect/psql/dialect/setcols.go to shared clause/setcols.go (clause.NewSetCols, clause.SetColsOptions). Dialect wrappers configure ToRow via SetColsOptions.RowPrefix (e.g. "ROW" on PostgreSQL). (thanks @atzedus)
    • EQ comparisons passed to SET / ON CONFLICT DO UPDATE SET / MERGE ... UPDATE SET / MySQL ON DUPLICATE KEY UPDATE render without the extra parentheses used in WHERE / ON (e.g. SET "users"."name" = $1 vs WHERE ("users"."name" = $1)). (thanks @atzedus)
    • NameAsExpr() on dialect View / Table types (PostgreSQL, SQLite, MySQL) omits a redundant AS when the alias matches the table name (for example FROM "users" instead of FROM "users" AS "users"). An explicit alias is still emitted when a schema is set at construction (AS "schema.table"). (thanks @atzedus)
    • Generated slice relationship loaders (<Parent>Slice.Load<Relationship>) now stitch loaded parents and children in O(N+M) using a map keyed by the join column, instead of the previous O(N×M) nested loop. This greatly speeds up eager-loading and then-loading relationships with many rows on both sides. The map is only used for single-column joins whose key type is comparable with ==; composite keys and types with a custom compare_expr (e.g. []byte) fall back to the original nested loop, so generated behaviour is unchanged. (thanks @sandonemaki)

    New Contributors

    Full Changelog: v0.45.0...v0.46.0

    Open source →
    Release notes

    Added

    • With() on generated queries as a more ergonomic method to add mods on top of generated queries (thanks @daddz)
    • Added Asc()/Desc()/... helpers to sm.OrderCombined for PostgreSQL/MySQL (thanks @daddz)
    • Added SQLite um.SetCols(columns...) and im.SetCols(columns...) for tuple assignment in UPDATE ... SET and ON CONFLICT DO UPDATE SET (.ToExprs(...), .ToRow(...), .ToQuery(...)). SQLite renders (cols) = (exprs...); PostgreSQL ToRow still emits ROW (...). MySQL does not support tuple assignment — use multiple SetCol calls. (thanks @atzedus)

    Fixed

    • Fixed generated Setter.Apply wrapping all insert values in a single ExpressionFunc, which prevented BeforeInsertHooks and query mods from modifying individual column values via q.Values.Vals[row][columnIndex]. Base and SQLite codegen templates now emit one expression per column (MySQL already did). Generated SQL is unchanged. (thanks @atzedus)
    • Fixed generated query mods for combined UNION/INTERSECT/EXCEPT queries dropping or misrouting the first operand's ORDER BY/LIMIT/OFFSET into the combined-result clauses. (thanks @daddz)
    • Fixed PostgreSQL um / dm standalone join mods (InnerJoin, LeftJoin, etc.) applied before um.From(...) / dm.Using(...): the join is now preserved and attached to the next FROM / USING from_item instead of being dropped. (thanks @atzedus)
    • Fixed/extended PostgreSQL sm.From(...): it now accepts variadic join chains (sm.From(table, joins...)), and inline joins are merged with already attached standalone joins when replacing the primary FROM source. (thanks @atzedus)

    Changed

    • Moved PostgreSQL SetCols tuple-assignment builder from dialect/psql/dialect/setcols.go to shared clause/setcols.go (clause.NewSetCols, clause.SetColsOptions). Dialect wrappers configure ToRow via SetColsOptions.RowPrefix (e.g. "ROW" on PostgreSQL). (thanks @atzedus)
    • EQ comparisons passed to SET / ON CONFLICT DO UPDATE SET / MERGE ... UPDATE SET / MySQL ON DUPLICATE KEY UPDATE render without the extra parentheses used in WHERE / ON (e.g. SET "users"."name" = $1 vs WHERE ("users"."name" = $1)). (thanks @atzedus)
    • NameAsExpr() on dialect View / Table types (PostgreSQL, SQLite, MySQL) omits a redundant AS when the alias matches the table name (for example FROM "users" instead of FROM "users" AS "users"). An explicit alias is still emitted when a schema is set at construction (AS "schema.table"). (thanks @atzedus)
    • Generated slice relationship loaders (<Parent>Slice.Load<Relationship>) now stitch loaded parents and children in O(N+M) using a map keyed by the join column, instead of the previous O(N×M) nested loop. This greatly speeds up eager-loading and then-loading relationships with many rows on both sides. The map is only used for single-column joins whose key type is comparable with ==; composite keys and types with a custom compare_expr (e.g. []byte) fall back to the original nested loop, so generated behaviour is unchanged. (thanks @sandonemaki)
    Open source →
  15. v0.45.1-0.20260602130909-c18ba1cb0501 02 Jun 2026 pre-release

    Nothing published for this version

  16. v0.45.0 28 May 2026
    Release notes

    Added

    • Added Schema() method to dialect View types (PostgreSQL, SQLite). (thanks @atzedus)
    • Added ColumnsExpr() method on psql.View for parity with MySQL and SQLite views. (thanks @atzedus)
    • Added um.SetExpr / im.SetExpr / mm.SetExpr for SET (and PostgreSQL/SQLite im.SetExpr for ON CONFLICT DO UPDATE SET) when the assignment LHS is a qualified or arbitrary expression — pass dialect.Quote(...) or another bob.Expression. SetCol / UpdateCol remain for a single column name (quoted automatically). (thanks @atzedus)

    Changed

    • BREAKING: psql.F / mysql.F / sqlite.F and dialect.NewFunction now take name any (was string). The name is rendered with bob.Express; use a string for a literal function name or dialect.Quote("schema", "fn") for qualified names. (thanks @atzedus)
    • BREAKING: mods.Set is now a struct with a Col any field instead of a []string alias. um.SetCol / im.SetCol / mm.SetCol (and MySQL im.UpdateCol) take a string column name and quote it automatically; use SetExpr for qualified or arbitrary LHS expressions. SetCol(...).To(...) / SetExpr(...).To(...) implement bob.Expression and can be passed to um.Set / im.Set / mm.Set to group several assignments in one mod (they still work as standalone query mods). (thanks @atzedus)
    • Godoc on sm.With, sm.Window, wm.BasedOn (PostgreSQL, MySQL, SQLite) notes that CTE/window names are quoted as SQL identifiers. (thanks @atzedus)
    • BREAKING: PostgreSQL sm.ForUpdate, sm.ForNoKeyUpdate, sm.ForShare, and sm.ForKeyShare now take tables ...any instead of tables ...string. Pass psql.Quote(...) (or another Expression) for each locked relation (#693). (thanks @atzedus)
    • BREAKING: MySQL sm.ForUpdate and sm.ForShare now take tables ...any with the same semantics as PostgreSQL (mysql.Quote(...) when needed). (thanks @atzedus)
    • BREAKING: clause.Lock.Tables is now []any instead of []string (used by FOR UPDATE / FOR SHARE rendering). (thanks @atzedus)
    • BREAKING: View / Table Name() now returns the bare table (or view) name as string. In v0.44.0, Name() returned a dialect Expression (qualified table reference for SQL). That role moved to new methods:
      • NameExpr() — what Name() did in v0.44.0 (on PostgreSQL and SQLite, respects UseSchema when schema was generated empty)
      • NameAsExpr() — what NameAs() did in v0.44.0 (name plus table alias)
        Update manual call sites, codegen templates, and generated models: Users.Name() in SQL builders → Users.NameExpr(), Users.NameAs()Users.NameAsExpr(); use Users.Name() when you need the unqualified name string. On PostgreSQL and SQLite, Schema() still returns the schema when set.
    • Codegen templates and orm.Preload now use NameExpr() / NameAsExpr() instead of Name() / NameAs(). (thanks @atzedus)

    Fixed

    • Fixed SQL identifier quoting in shared clause builders (CTE names/columns, window names, ON CONFLICT ON CONSTRAINT, WHERE CURRENT OF, partition/index lists, SQLite INDEXED BY) and PostgreSQL MERGE/SetCols column lists, table-function column definitions, and MySQL optimizer-hint table lists. Simple identifier parameters are quoted automatically; pass dialect.Quote(...) for qualified names in any slots (From, OnConflict, FOR UPDATE OF, etc.). (thanks @atzedus)
    • Fixed PostgreSQL sm.From clearing joins already on the FROM from_item (e.g. sm.CrossJoin before sm.From) because SelectQuery.AppendTableRef replaced the entire embedded FROM table ref. Existing joins are merged into the new primary table ref. (thanks @atzedus)
    • Fixed FOR UPDATE / FOR SHARE OF table lists: pass psql.Quote(...) / mysql.Quote(...) so names with spaces or qualification render correctly (#693). (thanks @atzedus)
    • Fixed MySQL sm.From(...).UseIndex / ForceIndex / IgnoreIndex (and *ForJoin / *ForOrderBy / *ForGroupBy variants) not appearing in generated SQL because FromChain.Apply did not copy IndexHints onto the query. (thanks @atzedus)
    • Fixed generated models using the wrong column qualifier when a table was constructed with a non-empty schema. Codegen previously passed table.Key into build*Columns and pkEQ / pkIN, but dialect View / Table types use schema.table as Alias() whenever schema is set at construction. That mismatch produced SQL such as `users`.`id` in WHERE while FROM used `myapp`.`users` AS `myapp.users` (columns and primary-key expressions did not match the table alias from NameAsExpr()). Templates now use a tableColumnAlias helper: schema.name when schema is set, otherwise table.Key. (thanks @atzedus)
    • Fix issue with overwriting unique constraints for tables beloging to other schemas. . (thanks @eaglehuntt and @MD-Mushfiqur123)

    New Contributors

    Full Changelog: v0.44.0...v0.45.0

    Open source →
    Release notes

    Added

    • Added Schema() method to dialect View types (PostgreSQL, SQLite). (thanks @atzedus)
    • Added ColumnsExpr() method on psql.View for parity with MySQL and SQLite views. (thanks @atzedus)
    • Added um.SetExpr / im.SetExpr / mm.SetExpr for SET (and PostgreSQL/SQLite im.SetExpr for ON CONFLICT DO UPDATE SET) when the assignment LHS is a qualified or arbitrary expression — pass dialect.Quote(...) or another bob.Expression. SetCol / UpdateCol remain for a single column name (quoted automatically). (thanks @atzedus)

    Changed

    • BREAKING: psql.F / mysql.F / sqlite.F and dialect.NewFunction now take name any (was string). The name is rendered with bob.Express; use a string for a literal function name or dialect.Quote("schema", "fn") for qualified names. (thanks @atzedus)
    • BREAKING: mods.Set is now a struct with a Col any field instead of a []string alias. um.SetCol / im.SetCol / mm.SetCol (and MySQL im.UpdateCol) take a string column name and quote it automatically; use SetExpr for qualified or arbitrary LHS expressions. SetCol(...).To(...) / SetExpr(...).To(...) implement bob.Expression and can be passed to um.Set / im.Set / mm.Set to group several assignments in one mod (they still work as standalone query mods). (thanks @atzedus)
    • Godoc on sm.With, sm.Window, wm.BasedOn (PostgreSQL, MySQL, SQLite) notes that CTE/window names are quoted as SQL identifiers. (thanks @atzedus)
    • BREAKING: PostgreSQL sm.ForUpdate, sm.ForNoKeyUpdate, sm.ForShare, and sm.ForKeyShare now take tables ...any instead of tables ...string. Pass psql.Quote(...) (or another Expression) for each locked relation (#693). (thanks @atzedus)
    • BREAKING: MySQL sm.ForUpdate and sm.ForShare now take tables ...any with the same semantics as PostgreSQL (mysql.Quote(...) when needed). (thanks @atzedus)
    • BREAKING: clause.Lock.Tables is now []any instead of []string (used by FOR UPDATE / FOR SHARE rendering). (thanks @atzedus)
    • BREAKING: View / Table Name() now returns the bare table (or view) name as string. In v0.44.0, Name() returned a dialect Expression (qualified table reference for SQL). That role moved to new methods:
      • NameExpr() — what Name() did in v0.44.0 (on PostgreSQL and SQLite, respects UseSchema when schema was generated empty)
      • NameAsExpr() — what NameAs() did in v0.44.0 (name plus table alias) Update manual call sites, codegen templates, and generated models: Users.Name() in SQL builders → Users.NameExpr(), Users.NameAs()Users.NameAsExpr(); use Users.Name() when you need the unqualified name string. On PostgreSQL and SQLite, Schema() still returns the schema when set.
    • Codegen templates and orm.Preload now use NameExpr() / NameAsExpr() instead of Name() / NameAs(). (thanks @atzedus)

    Fixed

    • Fixed SQL identifier quoting in shared clause builders (CTE names/columns, window names, ON CONFLICT ON CONSTRAINT, WHERE CURRENT OF, partition/index lists, SQLite INDEXED BY) and PostgreSQL MERGE/SetCols column lists, table-function column definitions, and MySQL optimizer-hint table lists. Simple identifier parameters are quoted automatically; pass dialect.Quote(...) for qualified names in any slots (From, OnConflict, FOR UPDATE OF, etc.). (thanks @atzedus)
    • Fixed PostgreSQL sm.From clearing joins already on the FROM from_item (e.g. sm.CrossJoin before sm.From) because SelectQuery.AppendTableRef replaced the entire embedded FROM table ref. Existing joins are merged into the new primary table ref. (thanks @atzedus)
    • Fixed FOR UPDATE / FOR SHARE OF table lists: pass psql.Quote(...) / mysql.Quote(...) so names with spaces or qualification render correctly (#693). (thanks @atzedus)
    • Fixed MySQL sm.From(...).UseIndex / ForceIndex / IgnoreIndex (and *ForJoin / *ForOrderBy / *ForGroupBy variants) not appearing in generated SQL because FromChain.Apply did not copy IndexHints onto the query. (thanks @atzedus)
    • Fixed generated models using the wrong column qualifier when a table was constructed with a non-empty schema. Codegen previously passed table.Key into build*Columns and pkEQ / pkIN, but dialect View / Table types use schema.table as Alias() whenever schema is set at construction. That mismatch produced SQL such as `users`.`id` in WHERE while FROM used `myapp`.`users` AS `myapp.users` (columns and primary-key expressions did not match the table alias from NameAsExpr()). Templates now use a tableColumnAlias helper: schema.name when schema is set, otherwise table.Key. (thanks @atzedus)
    • Fix issue with overwriting unique constraints for tables beloging to other schemas. (thanks @eaglehuntt and @MD-Mushfiqur123)
    Open source →
  17. v0.44.1-0.20260528001901-8bd1162b771a 28 May 2026 pre-release

    Nothing published for this version

  18. v0.44.1-0.20260525094416-24e585f7dd2a 25 May 2026 pre-release

    Nothing published for this version

  19. v0.44.1-0.20260521235148-3a2d78479220 21 May 2026 pre-release

    Nothing published for this version

  20. v0.44.0 21 May 2026
    Release notes

    Added

    • Added PostgreSQL MERGE statement SQL parser used for sql-to-code generation (thanks @atzedus)
    • Added R.Loaded to generated models, a nested struct with one bool per relationship that records whether each relationship has been loaded. This disambiguates "not loaded yet" from "loaded, but no related rows" for both to-one and to-many relations. Maintained automatically by Load*, Preload, ThenLoad, factory builds, and to-one Attach/Insert ops. The Loaded alias can be changed in the bob config. (thanks @jacobmolby)
    • Added As(alias) method to bob.BaseQuery, allowing queries (e.g. mysql.Select(...)) to be aliased directly when used as subqueries in a column list. (thanks @jacobmolby)
    • Added columns API: generated column structures now provide Name() string method. (thanks @atzedus)
    • Added expr.ColumnsExpr accessor methods: Parent() []string, AggFunc() [2]string, AliasPrefix() string, and AliasDisabled() bool. WithParent(...) now filters empty parts, and default rendering for plain unqualified columns no longer emits redundant self-aliases (e.g. "name" instead of "name" AS "name"). (thanks @atzedus)
    • Added bob.ParensOmitter interface with ShouldOmitParens() bool to let expressions opt out of automatic parenthesis wrapping in expression builders. (thanks @atzedus)
    • Added PostgreSQL RETURNING WITH (OLD AS ..., NEW AS ...) support for INSERT, UPDATE, DELETE, and MERGE query builders, including fluent modifiers: im/um/dm/mm.Returning(...).WithOldAs(...).WithNewAs(...). (thanks @atzedus)
      • Note: bobgen-psql sql-to-code parsing for this syntax is currently blocked by upstream PostgreSQL parser dependency support.
    • Added PostgreSQL TABLESAMPLE ... REPEATABLE ... support via fluent modifiers on sm.From(...) and join chains. (thanks @atzedus)
    • Added PostgreSQL JOIN ... USING (...) AS alias support via UsingAs(alias, cols...) on psql join chains. (thanks @atzedus)
    • Added PostgreSQL GROUP BY grouping-element helpers: sm.Grouping(...), sm.Rollup(...), sm.Cube(...), and sm.GroupingSets(...). (thanks @atzedus)
    • Added PostgreSQL im.ConflictTarget(...) helper for composing ON CONFLICT target items with optional .Collate(...) and .OpClass(...) modifiers. (thanks @atzedus)
    • Added PostgreSQL UPDATE/MERGE tuple-assignment helper um.SetCols(columns...) with .ToExprs(...), .ToRow(...), and .ToQuery(...) support. (thanks @atzedus)
    • Added PostgreSQL UPDATE/DELETE um.WhereCurrentOf(cursor) modifier to render WHERE CURRENT OF <cursor>. (thanks @atzedus)
    • Added expr.NoSep sentinel to join expressions without any separator. The existing expr.Join default (space) is unchanged. (thanks @atzedus)
    • Added im.Excluded(column) helper (PostgreSQL and SQLite) for ON CONFLICT DO UPDATE assignments — renders as EXCLUDED."col" with no extra space, reused internally by im.SetExcluded(...) and available for direct use in im.SetCol(...).To(...). (thanks @atzedus)
    • Added PostgreSQL psql.TableFunctions(funcs) and sm.FromFunction / um.FromFunction / dm.UsingFunction helpers that return bob.Expression for table-function from_item sources (ROWS FROM (...) when multiple functions are given). (thanks @atzedus)
    • Added PostgreSQL um.From(table, joins...) and dm.Using(table, joins...) variadic join arguments so each appended from_item can include inline INNER JOIN, LEFT JOIN, CROSS JOIN, etc. (JoinChain builders). (thanks @atzedus)
    • Added bobgen-psql support for multiple UPDATE ... FROM / DELETE ... USING sources: sql-to-code emits AppendTableRef(...) per parsed from_item and resolves column sources from every item. (thanks @atzedus)

    Changed

    • BREAKING: Renamed the generated ThenLoadCount variable to SelectThenLoadCount for naming consistency with SelectThenLoad/InsertThenLoad/UpdateThenLoad. Update call sites from models.ThenLoadCount.X.Y to models.SelectThenLoadCount.X.Y. (thanks @jacobmolby)
    • BREAKING: mm.SetCol() now returns mods.Set[*mm.UpdateAction] instead of a custom SetChain type. .ToExpr(val) is replaced by .To(val), and .ToDefault() is replaced by .To(psql.Raw("DEFAULT")). .To() and .ToArg() work as before. (thanks @atzedus)
    • BREAKING: mm.Recursive() has been removed. PostgreSQL does not support WITH RECURSIVE in MERGE statements. (thanks @atzedus)
    • BREAKING: Generated *Columns accessor fields now return a dialect-specific wrapper type (e.g., userColumn) instead of plain dialect.Expression. The wrapper still implements dialect.Expression and avoids extra auto-parentheses in expression builders. Use .Expression only when you explicitly need the embedded expression value. (thanks @atzedus)
    • BREAKING: PostgreSQL UPDATE ... FROM and DELETE ... USING additional sources now live in UpdateQuery.FromItems / DeleteQuery.UsingItems instead of the embedded clause.TableRef on the query struct. Each um.From(...) or dm.Using(...) appends one comma-separated from_item (last call no longer wins). Use um.Table(...) / dm.From(...) for the update/delete target table. (thanks @atzedus)
    • BREAKING: PostgreSQL sm.FromFunction and um.FromFunction no longer return FromChain or apply FROM/USING by themselves. They return bob.Expression and must be passed to sm.From(...) / um.From(...) / dm.Using(...) — e.g. sm.From(sm.FromFunction(psql.F("generate_series", 1, 3)())) instead of sm.FromFunction(...). Aliasing and other table modifiers belong on sm.From(...) / um.From(...). (thanks @atzedus)
    • BREAKING: PostgreSQL sm.From / FromChain for SelectQuery now set the FROM source via AppendTableRef (replace semantics) instead of SetTable / SetTableAlias on a fromable interface. (thanks @atzedus)
    • BREAKING: PostgreSQL um / dm join helpers (InnerJoin, LeftJoin, CrossJoin, etc.) return JoinChain[*UpdateQuery] / JoinChain[*DeleteQuery]. Use them in um.From(table, joins...) / dm.Using(table, joins...), or as standalone mods after um.From / dm.UsingAppendJoin then attaches to the last FromItems / UsingItems entry. (thanks @atzedus)
    • BREAKING: PostgreSQL psql join chain modifiers .Natural(), .On(), .OnEQ(), .Using(), and .UsingAs() now return JoinChain for fluent chaining instead of bob.Mod. (thanks @atzedus)

    Fixed

    • Fix PostgreSQL sm.From replacing a previous FROM without clearing a stale table alias when the new source has no alias. (thanks @atzedus)
    • Fix PostgreSQL sm.With(...).SearchBreadth(...) rendering SEARCH DEPTH instead of SEARCH BREADTH in CTE queries. (thanks @atzedus)
    • Avoid unnecessary imports in generated random factory code when a type has no random expression. (thanks @jay-babu)
    • Fix missing base type imports (e.g. github.com/google/uuid) in generated models when using type_system: "database/sql" and uuid_pkg: google, which could cause compile errors in generated many-to-many relation helpers. (thanks @atzedus)
    • Reuse parents when creating children in factory (thanks @abdusco)

    New Contributors

    Full Changelog: v0.43.0...v0.44.0

    Open source →
    Release notes

    Added

    • Added PostgreSQL MERGE statement SQL parser used for sql-to-code generation (thanks @atzedus)
    • Added R.Loaded to generated models, a nested struct with one bool per relationship that records whether each relationship has been loaded. This disambiguates "not loaded yet" from "loaded, but no related rows" for both to-one and to-many relations. Maintained automatically by Load*, Preload, ThenLoad, factory builds, and to-one Attach/Insert ops. The Loaded alias can be changed in the bob config. (thanks @jacobmolby)
    • Added As(alias) method to bob.BaseQuery, allowing queries (e.g. mysql.Select(...)) to be aliased directly when used as subqueries in a column list. (thanks @jacobmolby)
    • Added columns API: generated column structures now provide Name() string method. (thanks @atzedus)
    • Added expr.ColumnsExpr accessor methods: Parent() []string, AggFunc() [2]string, AliasPrefix() string, and AliasDisabled() bool. WithParent(...) now filters empty parts, and default rendering for plain unqualified columns no longer emits redundant self-aliases (e.g. "name" instead of "name" AS "name"). (thanks @atzedus)
    • Added bob.ParensOmitter interface with ShouldOmitParens() bool to let expressions opt out of automatic parenthesis wrapping in expression builders. (thanks @atzedus)
    • Added PostgreSQL RETURNING WITH (OLD AS ..., NEW AS ...) support for INSERT, UPDATE, DELETE, and MERGE query builders, including fluent modifiers: im/um/dm/mm.Returning(...).WithOldAs(...).WithNewAs(...). (thanks @atzedus)
      • Note: bobgen-psql sql-to-code parsing for this syntax is currently blocked by upstream PostgreSQL parser dependency support.
    • Added PostgreSQL TABLESAMPLE ... REPEATABLE ... support via fluent modifiers on sm.From(...) and join chains. (thanks @atzedus)
    • Added PostgreSQL JOIN ... USING (...) AS alias support via UsingAs(alias, cols...) on psql join chains. (thanks @atzedus)
    • Added PostgreSQL GROUP BY grouping-element helpers: sm.Grouping(...), sm.Rollup(...), sm.Cube(...), and sm.GroupingSets(...). (thanks @atzedus)
    • Added PostgreSQL im.ConflictTarget(...) helper for composing ON CONFLICT target items with optional .Collate(...) and .OpClass(...) modifiers. (thanks @atzedus)
    • Added PostgreSQL UPDATE/MERGE tuple-assignment helper um.SetCols(columns...) with .ToExprs(...), .ToRow(...), and .ToQuery(...) support. (thanks @atzedus)
    • Added PostgreSQL UPDATE/DELETE um.WhereCurrentOf(cursor) modifier to render WHERE CURRENT OF <cursor>. (thanks @atzedus)
    • Added expr.NoSep sentinel to join expressions without any separator. The existing expr.Join default (space) is unchanged. (thanks @atzedus)
    • Added im.Excluded(column) helper (PostgreSQL and SQLite) for ON CONFLICT DO UPDATE assignments — renders as EXCLUDED."col" with no extra space, reused internally by im.SetExcluded(...) and available for direct use in im.SetCol(...).To(...). (thanks @atzedus)
    • Added PostgreSQL psql.TableFunctions(funcs) and sm.FromFunction / um.FromFunction / dm.UsingFunction helpers that return bob.Expression for table-function from_item sources (ROWS FROM (...) when multiple functions are given). (thanks @atzedus)
    • Added PostgreSQL um.From(table, joins...) and dm.Using(table, joins...) variadic join arguments so each appended from_item can include inline INNER JOIN, LEFT JOIN, CROSS JOIN, etc. (JoinChain builders). (thanks @atzedus)
    • Added bobgen-psql support for multiple UPDATE ... FROM / DELETE ... USING sources: sql-to-code emits AppendTableRef(...) per parsed from_item and resolves column sources from every item. (thanks @atzedus)

    Changed

    • BREAKING: Renamed the generated ThenLoadCount variable to SelectThenLoadCount for naming consistency with SelectThenLoad/InsertThenLoad/UpdateThenLoad. Update call sites from models.ThenLoadCount.X.Y to models.SelectThenLoadCount.X.Y. (thanks @jacobmolby)
    • BREAKING: mm.SetCol() now returns mods.Set[*mm.UpdateAction] instead of a custom SetChain type. .ToExpr(val) is replaced by .To(val), and .ToDefault() is replaced by .To(psql.Raw("DEFAULT")). .To() and .ToArg() work as before. (thanks @atzedus)
    • BREAKING: mm.Recursive() has been removed. PostgreSQL does not support WITH RECURSIVE in MERGE statements. (thanks @atzedus)
    • BREAKING: Generated *Columns accessor fields now return a dialect-specific wrapper type (e.g., userColumn) instead of plain dialect.Expression. The wrapper still implements dialect.Expression and avoids extra auto-parentheses in expression builders. Use .Expression only when you explicitly need the embedded expression value. (thanks @atzedus)
    • BREAKING: PostgreSQL UPDATE ... FROM and DELETE ... USING additional sources now live in UpdateQuery.FromItems / DeleteQuery.UsingItems instead of the embedded clause.TableRef on the query struct. Each um.From(...) or dm.Using(...) appends one comma-separated from_item (last call no longer wins). Use um.Table(...) / dm.From(...) for the update/delete target table. (thanks @atzedus)
    • BREAKING: PostgreSQL sm.FromFunction and um.FromFunction no longer return FromChain or apply FROM/USING by themselves. They return bob.Expression and must be passed to sm.From(...) / um.From(...) / dm.Using(...) — e.g. sm.From(sm.FromFunction(psql.F("generate_series", 1, 3)())) instead of sm.FromFunction(...). Aliasing and other table modifiers belong on sm.From(...) / um.From(...). (thanks @atzedus)
    • BREAKING: PostgreSQL sm.From / FromChain for SelectQuery now set the FROM source via AppendTableRef (replace semantics) instead of SetTable / SetTableAlias on a fromable interface. (thanks @atzedus)
    • BREAKING: PostgreSQL um / dm join helpers (InnerJoin, LeftJoin, CrossJoin, etc.) return JoinChain[*UpdateQuery] / JoinChain[*DeleteQuery]. Use them in um.From(table, joins...) / dm.Using(table, joins...), or as standalone mods after um.From / dm.UsingAppendJoin then attaches to the last FromItems / UsingItems entry. (thanks @atzedus)
    • BREAKING: PostgreSQL psql join chain modifiers .Natural(), .On(), .OnEQ(), .Using(), and .UsingAs() now return JoinChain for fluent chaining instead of bob.Mod. (thanks @atzedus)

    Fixed

    • Fix PostgreSQL sm.From replacing a previous FROM without clearing a stale table alias when the new source has no alias. (thanks @atzedus)
    • Fix PostgreSQL sm.With(...).SearchBreadth(...) rendering SEARCH DEPTH instead of SEARCH BREADTH in CTE queries. (thanks @atzedus)
    • Avoid unnecessary imports in generated random factory code when a type has no random expression. (thanks @jay-babu)
    • Fix missing base type imports (e.g. github.com/google/uuid) in generated models when using type_system: "database/sql" and uuid_pkg: google, which could cause compile errors in generated many-to-many relation helpers. (thanks @atzedus)
    • Reuse parents when creating children in factory (thanks @abdusco)
    Open source →
  21. v0.43.1-0.20260515161103-b81c763b87df 15 May 2026 pre-release

    Nothing published for this version

  22. v0.43.1-0.20260513003548-f4795cd9f32b 13 May 2026 pre-release

    Nothing published for this version

  23. v0.43.1-0.20260508142052-4adc5449dce2 08 May 2026 pre-release

    Nothing published for this version

  24. v0.43.1-0.20260506224915-316333a7411b 06 May 2026 pre-release

    Nothing published for this version

  25. v0.43.1-0.20260505062107-b4f99edf899c 05 May 2026 pre-release

    Nothing published for this version

  26. v0.43.0 29 Apr 2026
    Release notes

    Added

    • Added PostgreSQL MERGE statement support with full syntax including:
      • MERGE INTO ... USING ... ON ... with table aliases and ONLY modifier
      • WHEN MATCHED, WHEN NOT MATCHED, WHEN NOT MATCHED BY SOURCE clauses
      • UPDATE, INSERT, DELETE, DO NOTHING actions
      • Support for AND condition in WHEN clauses
      • OVERRIDING SYSTEM VALUE and OVERRIDING USER VALUE for INSERT actions
      • RETURNING clause support (PostgreSQL 17+) (thanks @atzedus)
      • Note: the SQL parser used for sql-to-code generation does not yet support MERGE statements
    • Added psql.SetVersion, psql.GetVersion, and psql.VersionAtLeast functions for context-based PostgreSQL version management (thanks @atzedus)
    • Added Table.Merge() method for ORM-style MERGE operations with automatic RETURNING * for PostgreSQL 17+ (thanks @atzedus)
    • Added mm package with modifiers for building MERGE queries (mm.Into, mm.Using, mm.WhenMatched, mm.WhenNotMatched, mm.WhenNotMatchedBySource, etc.) (thanks @atzedus)
    • Added enum_format configuration option to control enum value identifier formatting. Options: "title_case" (default, e.g., InProgress) or "screaming_snake_case" (e.g., IN_PROGRESS).
    • Added Unqualified() method to generated column structures that returns columns without table alias/prefix. (thanks @atzedus)
    • Added PreloadCount and ThenLoadCount to generate code for preloading and then loading counts for relationships. (thanks @jacobmolby)
    • MySQL support for insert queries executing loaders (e.g., InsertThenLoad, InsertThenLoadCount). (thanks @jacobmolby)
    • Added overwritable hooks that are run before the exec or scanning test of generated queries. This allows seeding data before the test runs.
    • Added bob.Each function to iterate over query results (range-over-func). (thanks @toqueteos)
    • Added support for the VALUES statement in MySQL, PostgreSQL, and SQLite. (thanks @manhrev)
    • Added MariaDB compatibility check in gen/bobgen-mysql (thanks @dumdev25)
    • Added ALL, SOME, ANY expressions for MySQL and PostgreSQL dialects. Added EXISTS expression for all dialects. (thanks @manhrev)
    • Added a customizable MySQL and PostgreSQL driver image setting for bobgen-sql. (thanks @manhrev)

    Fixed

    • Fix pgx driver Commit() returning nil instead of pgx.ErrTxClosed when the transaction is already closed (e.g., rolled back by context expiry). This prevented silent data loss by correctly propagating the error to the caller. (thanks @wucm667)
    • Fix self-referencing relationship back-references so generated preload/load helpers no longer create cyclic parent links. (thanks @atzedus)
    • Fix collisions for preloader alias generation. Replaced RandInt with NextUniqueInt (thanks @atzedus)
    • Fix an issue where the random function of aliased custom types were not being used in generated query tests.
    • Properly recognize placeholders in LIMIT and OFFSET when generating queries for PostgreSQL.
    • Throw an error on an empty SET clause during SQL generation rather than sending invalid syntax to database. (thanks @Xaeroxe)
    • Fix MySQL Insert().One()/All()/Cursor() using SELECT * instead of explicit model columns when re-fetching inserted rows, consistent with PostgreSQL/SQLite RETURNING. (thanks @tak848)

    New Contributors

    Full Changelog: v0.42.0...v0.43.0

    Open source →
    Release notes

    Added

    • Added PostgreSQL MERGE statement support with full syntax including:
      • MERGE INTO ... USING ... ON ... with table aliases and ONLY modifier
      • WHEN MATCHED, WHEN NOT MATCHED, WHEN NOT MATCHED BY SOURCE clauses
      • UPDATE, INSERT, DELETE, DO NOTHING actions
      • Support for AND condition in WHEN clauses
      • OVERRIDING SYSTEM VALUE and OVERRIDING USER VALUE for INSERT actions
      • RETURNING clause support (PostgreSQL 17+) (thanks @atzedus)
      • Note: the SQL parser used for sql-to-code generation does not yet support MERGE statements
    • Added psql.SetVersion, psql.GetVersion, and psql.VersionAtLeast functions for context-based PostgreSQL version management (thanks @atzedus)
    • Added Table.Merge() method for ORM-style MERGE operations with automatic RETURNING * for PostgreSQL 17+ (thanks @atzedus)
    • Added mm package with modifiers for building MERGE queries (mm.Into, mm.Using, mm.WhenMatched, mm.WhenNotMatched, mm.WhenNotMatchedBySource, etc.) (thanks @atzedus)
    • Added enum_format configuration option to control enum value identifier formatting. Options: "title_case" (default, e.g., InProgress) or "screaming_snake_case" (e.g., IN_PROGRESS).
    • Added Unqualified() method to generated column structures that returns columns without table alias/prefix. (thanks @atzedus)
    • Added PreloadCount and ThenLoadCount to generate code for preloading and then loading counts for relationships. (thanks @jacobmolby)
    • MySQL support for insert queries executing loaders (e.g., InsertThenLoad, InsertThenLoadCount). (thanks @jacobmolby)
    • Added overwritable hooks that are run before the exec or scanning test of generated queries. This allows seeding data before the test runs.
    • Added bob.Each function to iterate over query results (range-over-func). (thanks @toqueteos)
    • Added support for the VALUES statement in MySQL, PostgreSQL, and SQLite. (thanks @manhrev)
    • Added MariaDB compatibility check in gen/bobgen-mysql (thanks @dumdev25)
    • Added ALL, SOME, ANY expressions for MySQL and PostgreSQL dialects. Added EXISTS expression for all dialects. (thanks @manhrev)
    • Added a customizable MySQL and PostgreSQL driver image setting for bobgen-sql. (thanks @manhrev)
    • Added support for Materialized Views in PostgreSQL code generation. (thanks @PudottaPommin)

    Fixed

    • Fix pgx driver Commit() returning nil instead of pgx.ErrTxClosed when the transaction is already closed (e.g., rolled back by context expiry). This prevented silent data loss by correctly propagating the error to the caller. (thanks @wucm667)
    • Fix factory FromExisting methods causing stack overflow when models have bidirectional relationships populated (thanks @wucm667)
    • Fix self-referencing relationship back-references so generated preload/load helpers no longer create cyclic parent links. (thanks @atzedus)
    • Fix collisions for preloader alias generation. Replaced RandInt with NextUniqueInt (thanks @atzedus)
    • Fix an issue where the random function of aliased custom types were not being used in generated query tests.
    • Properly recognize placeholders in LIMIT and OFFSET when generating queries for PostgreSQL.
    • Throw an error on an empty SET clause during SQL generation rather than sending invalid syntax to database. (thanks @Xaeroxe)
    • Fix MySQL Insert().One()/All()/Cursor() using SELECT * instead of explicit model columns when re-fetching inserted rows, consistent with PostgreSQL/SQLite RETURNING. (thanks @tak848)
    Open source →
  27. v0.42.1-0.20260425214547-febd197867b3 25 Apr 2026 pre-release

    Nothing published for this version

  28. v0.42.1-0.20260414223129-e84c7f4903c1 14 Apr 2026 pre-release

    Nothing published for this version

  29. v0.42.1-0.20260411215148-c4319ea563dd 11 Apr 2026 pre-release

    Nothing published for this version

  30. v0.42.1-0.20260405025056-50353154d239 05 Apr 2026 pre-release

    Nothing published for this version

  31. v0.42.1-0.20260311201022-d4f6947b4a26 11 Mar 2026 pre-release

    Nothing published for this version

  32. v0.42.1-0.20260305085859-d9c40b0abedd 05 Mar 2026 pre-release

    Nothing published for this version

  33. v0.42.1-0.20260220013441-4d86d6fb6efb 20 Feb 2026 pre-release

    Nothing published for this version

  34. v0.42.1-0.20260206110159-054d6b9081cd 06 Feb 2026 pre-release

    Nothing published for this version

  35. v0.42.1-0.20260124111142-e9f809880659 24 Jan 2026 pre-release

    Nothing published for this version

  36. v0.42.1-0.20260111231722-1ab321a734f1 11 Jan 2026 pre-release

    Nothing published for this version

  37. v0.42.1-0.20260105094834-4f81249fd9a8 05 Jan 2026 pre-release

    Nothing published for this version

  38. v0.42.0 25 Nov 2025
    Release notes

    Fixed

    • Fixed a bug where the generated loaders for many-to-many relationships were skipping related rows. (thanks @TylerJGabb)

    Added

    • Include shell.nix for developers using Nix to create development environments. (thanks @EliRibble)
    • Additional README content on how developers can use linting and unit testing to contribute. (thanks @EliRibble)
    • Added Plus expression chain method (thanks @atzedus).

    Changed

    • Export orm.NullTypeConverter. (thanks @Serjlee)
    • Uses io.StringWriter instead of io.Writer for efficiency since we are always writing strings.

    New Contributors

    Full Changelog: v0.41.1...v0.42.0

    Open source →
    Release notes

    Fixed

    • Fixed a bug where the generated loaders for many-to-many relationships were skipping related rows. (thanks @TylerJGabb)

    Added

    • Include shell.nix for developers using Nix to create development environments. (thanks @EliRibble)
    • Additional README content on how developers can use linting and unit testing to contribute. (thanks @EliRibble)
    • Added Plus expression chain method (thanks @atzedus).

    Changed

    • Export orm.NullTypeConverter. (thanks @Serjlee)
    • Uses io.StringWriter instead of io.Writer for efficiency since we are always writing strings.
    Open source →
  39. v0.41.2-0.20251016212905-96da65fd88a5 16 Oct 2025 pre-release

    Nothing published for this version

  40. v0.41.1 02 Sep 2025
    Release notes

    Fixed

    • Properly handle code generation tests for compound queries in MySQL.

    Full Changelog: v0.41.0...v0.41.1

    Open source →
    Release notes

    Fixed

    • Properly handle code generation tests for compound queries in MySQL.
    Open source →
  41. v0.41.0 02 Sep 2025
    Release notes

    Added

    • drivers/pgx.Pool now includes the methods Acquire and AcquireFunc which mirror the methods in pgx/v5/pgxpool to acquire a connection from the pool (thanks @Eyal-Shalev).
    • Added the drivers/pgx.PoolConn type which is a wrapper around pgx/v5/pgxpool.Conn.

    Changed

    • Use the full column type and not just the datatype as the DBType in bobgen-mysql.
    • bob.Transactor is now a generic interface so that implementations can use a concrete transaction type.
    • The data types generated for SQLite now follow SQLite's type affinity rules more closely (excluding some common names). As a result, all integer types are now mapped to int64 and all floating point types are mapped to float64.

    Fixed

    • Fixed an issue where bobgen-mysql could not detect unsigned integer columns in queries.
    • Properly close pgx transactions if the context used in BeginTx is cancelled.
    • Fix issues with generating code for relationships defined with WhereExpr.
    • Support uint64 type when scanning columns as types.Uint64. This fixes scanning BIGINT UNSIGNED MySQL columns as types.Uint64 when interpolateParams is enabled. (thanks @luiscleto)
    • Properly handle code generation tests for compound queries in MySQL.
    • Fix an issue where some ids are uppercased by the MySQL query code generator.
    Open source →
  42. v0.40.3-0.20250828221845-a864228459c7 28 Aug 2025 pre-release

    Nothing published for this version

  43. v0.40.3-0.20250819175115-2ca61849c6db 19 Aug 2025 pre-release

    Nothing published for this version

  44. v0.40.2 16 Aug 2025
    Release notes

    Fixed

    • Fixed Scanner/Valuer test gen for types defined in the models package.
    • Fix issue with randomization test when enum is only used in an array.
    • Fix issue with using CompareExpr with values that are null.
    • Fix issue with imports in query tests.
    • Fix issue with detecting the columns in a CTE in bobgen-psql.
    • Properly detect the end of a function call in postgres qury parser.
    Open source →
  45. v0.40.1 14 Aug 2025
    Release notes

    Fixed

    • Fixed bug in preloading
    Open source →
  46. v0.40.0 13 Aug 2025 withdrawn

    Version retracted: Fatal bug in preloading relationships with `models.Preload.<Table>.<Relationship>()`

    Release notes

    Added

    • Made code generation modular by relying on built-in plugins that can be enabled or disabled in the configuration.
      • dbinfo: Generates code for information about each database. Schemas, tables, columns, indexes, primary keys, foreign keys, unique constraints, and check constraints.
      • enums: Generates code for enums in a separate package, if there are any present.
      • models: Generates code for models. Depends on enums.
      • factory: Generates code for factories. Depends on models.
      • dberrors: Generates code for unique constraint errors. Depends on models.
      • where: Generates type-safe code for WHERE clauses in queries. Depends on models.
      • loaders: Adds templates to the models package to generate code for loaders e.g models.SelectThenLoad.Table.Rel().
      • joins: Adds templates to the models package to generate code for joins e.g models.SelectJoin.Table.LeftJoin.Rel.
      • queries: Generates code for queries.
    • Added new types.Uint64 type that sends values to the database as strings. This is necessary because using uint64 directly can cause an overflow if the value exceeds the maximum value of an int64. This is a limitation imposed by database/sql/driver.Valuer interface.
    • Added support for pgvector types during code generation.
      • pgvector.Vector
      • pgvector.HalfVector
      • pgvector.SparseVector

    Changed

    • Enums are now imported directly from a new generated enums package. This makes it easier to use enums in other packages without having to depend on the models package.
    • Preload functions now take a custom orm.PreloadRel struct instead of reusing orm.Relationship.
    • By default, factories are now generated in ./factory instead of ./models/factory.
    • Outputs are now determined by plugins which can be enabled or disabled in the configuration.
    • UniqueConstraintErrors are now generated in a separate dberrors package instead of being generated in the models package.
    • Tests in the generated models package are no longer generated in a separate models_test package. There is no longer any circular dependency since tests for the unique constraint errors are generated in the dberrors package.
    • orm.Columns has been moved to expr.ColumnsExpr.
    • orm.NewColumns has been moved to expr.NewColumnsExpr.
    • <Table>.Columns() is removed. The columns expression is now expected to be embedded in the Columns field of the <Table> struct.
    • <dialect>.View and <dialect>.Table now take an additional type parameter for the columns type. This is assigned to the Columns field with NewView/NewTable functions.

    Removed

    • Removed the no_factory configuration option. It is now replaced with the factory plugin which can be enabled or disabled. See https://bob.stephenafamo.com/docs/code-generation/configuration#plugins-configuration for more details.
    • Removed the Only and Except exported functions in orm. They are now in the private internal package.
    • Removed the generated models.<Model>Columns global variable. It can now be accessed through models.<Table>.Columns.
    • Removed the generated models.TableNames and models.ColumnNames global variables. Their use can be replaced with the dbinfo plugin which generates a dbinfo package with all the information about the database.

    Fixed

    • Fixed issue with redundant title casing column names in query templates. (thanks @luiscleto)
    • Fix invalid expression with pointer-based type systems. (thanks @tak848)
    • Fix panic when parsing SQLite UPDATE queries that do not contain a FROM clause.
    • Fix issue when using enums in generated queries.
    • Fix randomization of floats and decimals in the factory.
    • Fix JSON data being incorrectly hex-encoded as bytea when using pgx through simple protocol, causing PostgreSQL to reject it with invalid input syntax errors. (by @Maxitosh)
    • Fix issue with preload queries not using a defined schema on the related tables
    Open source →
  47. v0.39.1-0.20250811103155-d917f36e3025 11 Aug 2025 pre-release

    Nothing published for this version

  48. v0.39.1-0.20250810215143-ea7a9b5c289f 10 Aug 2025 pre-release

    Nothing published for this version

  49. v0.39.1-0.20250809232409-cffc0a4b1964 09 Aug 2025 pre-release

    Nothing published for this version

  50. v0.39.1-0.20250808135140-13ab15de2a1f 08 Aug 2025 pre-release

    Nothing published for this version

  51. v0.39.1-0.20250807162141-1a6196ec4705 07 Aug 2025 pre-release

    Nothing published for this version

  52. v0.39.1-0.20250806235548-c893d7d53f5e 06 Aug 2025 pre-release

    Nothing published for this version

  53. v0.39.1-0.20250804093216-b2e9e2d2da43 04 Aug 2025 pre-release

    Nothing published for this version

  54. v0.39.1-0.20250804092313-111b290e348a 04 Aug 2025 pre-release

    Nothing published for this version

  55. v0.39.1-0.20250731141400-45b4436fceba 31 Jul 2025 pre-release

    Nothing published for this version

  56. v0.39.0 28 Jul 2025
    Release notes

    Added

    • Added the As method to clause.TableRef, which sets the alias and return a copy of the struct. (thanks @Nitjsefni7)
    • Added the type_system configuration option to determine how to generate null and optional values in the generated code. Possible options: github.com/aarondl/opt, github.com/aarondl/opt/null or database/sql. The default value is github.com/aarondl/opt.
    • When generating code for queries, The All method of the generated query will return a struct with nested fields instead of a flat struct.
      • columns with dots (.) are assumed to be a to-many nested field.
      • columns with double underscores (__) are assumed to be a to-one nested field.
    • Implement --prefix annotation in queries for bobgen-psql.
    • Add FromExistingRel method to factories to create a template from an existing model. (thanks @dutow)
    • Add WithExistingRel to factory mods to attach an existing model as a relationship. (thanks @dutow)
    • Added support in psql for combined args (order by, limit etc.) in combined queries and use parens if they are present. (@iwyrkore)
    • Added parens for combined queries. (@iwyrkore)
    • Match columns using regular expressions in type replacements. This is useful for e.g. matching columns that have a common prefix or suffix. (thanks @abdusco)

    Changed

    • Mod is now a separate field in orm.ModQuery and orm.ModExecQuery.
    • Allx now takes a Transformer type parameter to transform the result of the query.
    • Updated documentation for readability, added code gen examples. (thanks @singhsays)
    • Columns are now matched in a case-insensitive manner in type replacements. (thanks @abdusco)
    • Columns can now be matched with as many conditions as needed in type replacements. This removes the previous requirement that boolean fields had to be specified in addition to a string field. (thanks @abdusco)
    • Factories now expose a NewXWithContext that accepts a context in addition to NewX that does not. This provides a cleaner API for the callers, while still allowing the use of context internally. (thanks @abdusco)

    Removed

    • Removed the fallback_null configuration option. It is now replaced with the type_system configuration option.

    Fixed

    • Fixed some issues with creating relationships in the factory by avoiding trying to reuse models.
    • Fix issues with generating code for queries with duplicate return column names.
    • Updated gen table detail queries to use context. (thanks @singhsays)
    • Properly detect bool, timestamp and timestamptz types in bobgen-psql.
    • Fix transformer for single result queries.
    • Properly handle indexes where the sorting order can be null.
    • Check for nullability when loading relationships.
    • Handle table names quoted with backticks in mysql query parser. (thanks @luiscleto)
    • Allow matching columns in type replacements by the autoincr property as stated in the docs. (thanks @abdusco)
    • Handle dashes and spaces in generated enum values properly (thanks @abdusco)
    • Check for nullability when loading relationships from Slices (thanks @felipeparaujo)
    Open source →
  57. v0.38.1-0.20250724174351-dd16525bdd3b 24 Jul 2025 pre-release

    Nothing published for this version

  58. v0.38.1-0.20250722094724-08202428a120 22 Jul 2025 pre-release

    Nothing published for this version

  59. v0.38.1-0.20250720193027-2f1f83bba3c1 20 Jul 2025 pre-release

    Nothing published for this version

  60. v0.38.1-0.20250720171859-5552e5def954 20 Jul 2025 pre-release

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive