Skip to content

deps(go): bump module github.com/stephenafamo/bob to v0.46.0#425

Open
updateclibot[bot] wants to merge 2 commits into
mainfrom
updatecli_main_09a6e72fdd63b4ab3dfc150e2d5a5719bc7c55d81cb7c6f15d06b8feea08d3c3
Open

deps(go): bump module github.com/stephenafamo/bob to v0.46.0#425
updateclibot[bot] wants to merge 2 commits into
mainfrom
updatecli_main_09a6e72fdd63b4ab3dfc150e2d5a5719bc7c55d81cb7c6f15d06b8feea08d3c3

Conversation

@updateclibot

@updateclibot updateclibot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

deps(go): bump module github.com/stephenafamo/bob

clean: go mod tidy

ran shell command "go mod tidy"

deps(go): bump module github.com/stephenafamo/bob to v0.46.0

go.mod updated Module path "github.com/stephenafamo/bob" version from "v0.45.0" to "v0.46.0"

v0.46.0
### 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
* @sandonemaki made their first contribution in https://github.com/stephenafamo/bob/pull/706

**Full Changelog**: https://github.com/stephenafamo/bob/compare/v0.45.0...v0.46.0
v0.45.0
### 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](https://github.com/stephenafamo/bob/issues/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](https://github.com/stephenafamo/bob/issues/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
* @MD-Mushfiqur123 made their first contribution in https://github.com/stephenafamo/bob/pull/699
* @eaglehuntt made their first contribution in https://github.com/stephenafamo/bob/pull/699

**Full Changelog**: https://github.com/stephenafamo/bob/compare/v0.44.0...v0.45.0
GitHub Action workflow link
Updatecli logo

Created automatically by Updatecli

Options:

Most of Updatecli configuration is done via its manifest(s).

  • If you close this pull request, Updatecli will automatically reopen it, the next time it runs.
  • If you close this pull request and delete the base branch, Updatecli will automatically recreate it, erasing all previous commits made.

Feel free to report any issues at github.com/updatecli/updatecli.
If you find this tool useful, do not hesitate to star our GitHub repository as a sign of appreciation, and/or to tell us directly on our chat!

updatecli added 2 commits June 12, 2026 06:41
Made with ❤️️ by updatecli
@updateclibot updateclibot Bot force-pushed the updatecli_main_09a6e72fdd63b4ab3dfc150e2d5a5719bc7c55d81cb7c6f15d06b8feea08d3c3 branch from 95c2dc1 to 4fd1c29 Compare June 12, 2026 06:46
@updateclibot updateclibot Bot added the dependencies Pull requests that update a dependency file label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants