NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules · #1031 by repository stars
Last release 1 months ago
31 Aug 2026
Ships fairly regularly
a new release about every 1 weeks
Nearly every release is documented
notes for 57 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
4 years old
332 releases · first in 2022
One column per quarter.
Nothing published for this version
Generated dberrors packages now include generic and per-table check-constraint errors for PostgreSQL, matched by constraint name for pq and pgx driver
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)<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)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)$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)Full Changelog: v0.49.0...v0.50.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added bob.NextUniqueInt() for generating unique SQL alias suffixes ( #719 ). (thanks @atzedus )
bob.NextUniqueInt() for generating unique SQL alias suffixes (#719). (thanks @atzedus)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)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)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)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).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)randInt(), which could produce negative values when maphash.Hash.Sum64() overflowed int64 (#719). Generated join mods now use bob.NextUniqueInt() instead. (thanks @atzedus)orm.Query.Clone() dropping the Scanner, which made All/One/Cursor/Each on a cloned query panic with a nil pointer dereference. (thanks @sandonemaki)* selectors in sql queries in postgresFull Changelog: v0.48.0...v0.49.0
bob.NextUniqueInt() for generating unique SQL alias suffixes (#719). (thanks @atzedus)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)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)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)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)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).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)randInt(), which could produce negative values when maphash.Hash.Sum64() overflowed int64 (#719). Generated join mods now use bob.NextUniqueInt() instead. (thanks @atzedus)orm.Query.Clone() dropping the Scanner, which made All/One/Cursor/Each on a cloned query panic with a nil pointer dereference. (thanks @sandonemaki)* selectors in sql queries in postgresNothing published for this version
Nothing published for this version
Nothing published for this version
PostgreSQL single-column relationship loaders — both the slice relationship query ( <Parent>Slice.<Rel> ) and the batch count method ( <Parent>Slice.L
<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)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
Nothing published for this version
Nothing published for this version
Added column_order config option (shared across all drivers). Set to "name" to sort generated model columns alphabetically, producing deterministic ou
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)RunInTx to pass bob.Transaction instead of bob.ExecutorFull Changelog: v0.46.0...v0.47.0
Nothing published for this version
With() on generated queries as a more ergonomic method to add mods on top of generated queries (thanks @daddz )
With() on generated queries as a more ergonomic method to add mods on top of generated queries (thanks @daddz)Asc()/Desc()/... helpers to sm.OrderCombined for PostgreSQL/MySQL (thanks @daddz)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)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)UNION/INTERSECT/EXCEPT queries dropping or misrouting the first operand's ORDER BY/LIMIT/OFFSET into the combined-result clauses. (thanks @daddz)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)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)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)<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)Full Changelog: v0.45.0...v0.46.0
Nothing published for this version
Added Schema() method to dialect View types (PostgreSQL, SQLite). (thanks @atzedus )
Schema() method to dialect View types (PostgreSQL, SQLite). (thanks @atzedus)ColumnsExpr() method on psql.View for parity with MySQL and SQLite views. (thanks @atzedus)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)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)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)sm.With, sm.Window, wm.BasedOn (PostgreSQL, MySQL, SQLite) notes that CTE/window names are quoted as SQL identifiers. (thanks @atzedus)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)sm.ForUpdate and sm.ForShare now take tables ...any with the same semantics as PostgreSQL (mysql.Quote(...) when needed). (thanks @atzedus)clause.Lock.Tables is now []any instead of []string (used by FOR UPDATE / FOR SHARE rendering). (thanks @atzedus)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)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.orm.Preload now use NameExpr() / NameAsExpr() instead of Name() / NameAs(). (thanks @atzedus)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)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)FOR UPDATE / FOR SHARE OF table lists: pass psql.Quote(...) / mysql.Quote(...) so names with spaces or qualification render correctly (#693). (thanks @atzedus)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)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)Full Changelog: v0.44.0...v0.45.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added PostgreSQL MERGE statement SQL parser used for sql-to-code generation (thanks @atzedus )
MERGE statement SQL parser used for sql-to-code generation (thanks @atzedus)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)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)Name() string method. (thanks @atzedus)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)bob.ParensOmitter interface with ShouldOmitParens() bool to let expressions opt out of automatic parenthesis wrapping in expression builders. (thanks @atzedus)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)
bobgen-psql sql-to-code parsing for this syntax is currently blocked by upstream PostgreSQL parser dependency support.TABLESAMPLE ... REPEATABLE ... support via fluent modifiers on sm.From(...) and join chains. (thanks @atzedus)JOIN ... USING (...) AS alias support via UsingAs(alias, cols...) on psql join chains. (thanks @atzedus)sm.Grouping(...), sm.Rollup(...), sm.Cube(...), and sm.GroupingSets(...). (thanks @atzedus)im.ConflictTarget(...) helper for composing ON CONFLICT target items with optional .Collate(...) and .OpClass(...) modifiers. (thanks @atzedus)um.SetCols(columns...) with .ToExprs(...), .ToRow(...), and .ToQuery(...) support. (thanks @atzedus)um.WhereCurrentOf(cursor) modifier to render WHERE CURRENT OF <cursor>. (thanks @atzedus)expr.NoSep sentinel to join expressions without any separator. The existing expr.Join default (space) is unchanged. (thanks @atzedus)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)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)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)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)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)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)mm.Recursive() has been removed. PostgreSQL does not support WITH RECURSIVE in MERGE statements. (thanks @atzedus)*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)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)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)sm.From / FromChain for SelectQuery now set the FROM source via AppendTableRef (replace semantics) instead of SetTable / SetTableAlias on a fromable interface. (thanks @atzedus)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.Using — AppendJoin then attaches to the last FromItems / UsingItems entry. (thanks @atzedus).Natural(), .On(), .OnEQ(), .Using(), and .UsingAs() now return JoinChain for fluent chaining instead of bob.Mod. (thanks @atzedus)sm.From replacing a previous FROM without clearing a stale table alias when the new source has no alias. (thanks @atzedus)sm.With(...).SearchBreadth(...) rendering SEARCH DEPTH instead of SEARCH BREADTH in CTE queries. (thanks @atzedus)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)Full Changelog: v0.43.0...v0.44.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added PostgreSQL MERGE statement support with full syntax including:
MERGE statement support with full syntax including:
MERGE INTO ... USING ... ON ... with table aliases and ONLY modifierWHEN MATCHED, WHEN NOT MATCHED, WHEN NOT MATCHED BY SOURCE clausesUPDATE, INSERT, DELETE, DO NOTHING actionsAND condition in WHEN clausesOVERRIDING SYSTEM VALUE and OVERRIDING USER VALUE for INSERT actionsRETURNING clause support (PostgreSQL 17+) (thanks @atzedus)MERGE statementspsql.SetVersion, psql.GetVersion, and psql.VersionAtLeast functions for context-based PostgreSQL version management (thanks @atzedus)Table.Merge() method for ORM-style MERGE operations with automatic RETURNING * for PostgreSQL 17+ (thanks @atzedus)mm package with modifiers for building MERGE queries (mm.Into, mm.Using, mm.WhenMatched, mm.WhenNotMatched, mm.WhenNotMatchedBySource, etc.) (thanks @atzedus)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).Unqualified() method to generated column structures that returns columns without table alias/prefix. (thanks @atzedus)PreloadCount and ThenLoadCount to generate code for preloading and then loading counts for relationships. (thanks @jacobmolby)InsertThenLoad, InsertThenLoadCount). (thanks @jacobmolby)bob.Each function to iterate over query results (range-over-func). (thanks @toqueteos)VALUES statement in MySQL, PostgreSQL, and SQLite. (thanks @manhrev)ALL, SOME, ANY expressions for MySQL and PostgreSQL dialects. Added EXISTS expression for all dialects. (thanks @manhrev)bobgen-sql. (thanks @manhrev)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)RandInt with NextUniqueInt (thanks @atzedus)Insert().One()/All()/Cursor() using SELECT * instead of explicit model columns when re-fetching inserted rows, consistent with PostgreSQL/SQLite RETURNING. (thanks @tak848)Full Changelog: v0.42.0...v0.43.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed a bug where the generated loaders for many-to-many relationships were skipping related rows. (thanks @TylerJGabb )
shell.nix for developers using Nix to create development environments. (thanks @EliRibble)Plus expression chain method (thanks @atzedus).orm.NullTypeConverter. (thanks @Serjlee)io.StringWriter instead of io.Writer for efficiency since we are always writing strings.Full Changelog: v0.41.1...v0.42.0
Nothing published for this version
Properly handle code generation tests for compound queries in MySQL.
Full Changelog: v0.41.0...v0.41.1
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 (th
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).drivers/pgx.PoolConn type which is a wrapper around pgx/v5/pgxpool.Conn.DBType in bobgen-mysql.bob.Transactor is now a generic interface so that implementations can use a concrete transaction type.int64 and all floating point types are mapped to float64.bobgen-mysql could not detect unsigned integer columns in queries.pgx transactions if the context used in BeginTx is cancelled.WhereExpr.uint64 type when scanning columns as types.Uint64. This fixes scanning BIGINT UNSIGNED MySQL columns as types.Uint64 when interpolateParams is enabled. (thanks @luiscleto)Nothing published for this version
Nothing published for this version
Fixed Scanner/Valuer test gen for types defined in the models package.
CompareExpr with values that are null.bobgen-psql.### Fixed - Fixed bug in preloading
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.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.pgvector types during code generation.
pgvector.Vectorpgvector.HalfVectorpgvector.SparseVectorenums package. This makes it easier to use enums in other packages without having to depend on the models package.orm.PreloadRel struct instead of reusing orm.Relationship../factory instead of ./models/factory.dberrors package instead of being generated in the models package.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.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.Only and Except exported functions in orm. They are now in the private internal package.models.<Model>Columns global variable. It can now be accessed through models.<Table>.Columns.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.UPDATE queries that do not contain a FROM clause.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added the As method to clause.TableRef, which sets the alias and return a copy of the struct. (thanks @Nitjsefni7)
As method to clause.TableRef, which sets the alias and return a copy of the struct. (thanks @Nitjsefni7)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.All method of the generated query will return a struct with nested fields instead of a flat struct.
.) are assumed to be a to-many nested field.__) are assumed to be a to-one nested field.--prefix annotation in queries for bobgen-psql.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.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)fallback_null configuration option. It is now replaced with the type_system configuration option.bool, timestamp and timestamptz types in bobgen-psql.autoincr property as stated in the docs. (thanks @abdusco)Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →