Releases: goware/pgkit
Release list
v2.9.2
This patch speeds up uniform batch inserts and restores generated values on multi-record inserts.
What's Changed
- Speed up uniform-shape
InsertRecordsbatches with a direct builder path. PR #60 - Populate caller records with database-generated IDs and defaults after multi-record
Table.Insert. PR #61
Full Changelog: v2.9.1...v2.9.2
v2.9.1
What's Changed
- perf(table): reuse RowScanner across Iter rows by @VojtechVitek in #57
Full Changelog: v2.9.0...v2.9.1
v2.9.0
What's Changed
- Table-mode cursor pagination —
Table.Modeselects howListPagedpaginates:PageBased(offset, the zero-value default) orCursorBased(keyset overIDColumn, forward-only, stable under concurrent writes). The first page takes direction from a supplied id-order (or a single id-column default sort); continuations feedPage.NextCursorback until empty. - Up-front page validation —
Page.Kind()classifies the supplied page; mismatches are rejected before any query runs: a cursor page to an offset table or a page number to a cursor table returnsErrPageKindMismatch, a page carrying both returnsErrCursorPaged. WithMode— plusModepreserved acrossWithTx/WithPaginator.Order.IsValid/Order.Sanitize— theOrdertype owns its validation and normalization;Page.SetDefaultstidied withcmp.Or.
Full Changelog: v2.8.0...v2.9.0
v2.8.0
What's Changed
- feat(builder): InsertDefaults for INSERT ... DEFAULT VALUES by @klaidliadon in #52
- feat(builder): union columns + DEFAULT for mixed-shape InsertRecords by @klaidliadon in #54
- feat: CursorPaginator for keyset pagination by @klaidliadon in #55
Full Changelog: v2.7.1...v2.8.0
v2.7.1
What's Changed
- feat(mapper): support ,omitzero tag option by @klaidliadon in #50
Full Changelog: v2.7.0...v2.7.1
v2.7.0
What's new
pgerr sub-package — Postgres error inspection
Helpers that operate on error (rather than raw SQLSTATE strings), built on pgconn.PgError:
pgerr.IsErrorNoRows(err) bool— fan-out overpgx.ErrNoRowsandsql.ErrNoRowspgerr.IsUniqueViolation(err) (string, bool)— comma-ok, returns the constraint name when SQLSTATE is23505pgerr.IsFatal(err) bool— class-based retry/alert gate: classes00/01/02/23are non-fatal; every other class is fatal; non-PgErrorerrors return false
pgerrcode constants stay in github.com/jackc/pgerrcode — import that package directly for the full table or pgerrcode's class-membership helpers.
DB.InTx(tx) *DB
func (d *DB) InTx(tx pgx.Tx) *DBReturns a new *DB sharing Conn and SQL with the parent but routing queries through tx. Complements the existing DB.TxQuery(tx) *Querier for callers that need to pass a tx-scoped *DB into functions taking *pgkit.DB without rewriting parameter types.
Named InTx (rather than WithTx) to keep distinct from the package-level pgkit.WithTx(ctx, tx) context.Context ctx helper.
Both additions are non-breaking. New dependency: github.com/jackc/pgerrcode.
v2.6.1
Bugfix release: bumps jackc/pgx/v5 to v5.9.0 to patch CVE-2026-33816 (CVSS 9.8 — memory-safety in pgproto3, exploitable via malformed protocol messages).
go directive bumps to 1.25.0 (pgx v5.9.0's declared minimum); toolchain go1.24.3 line drops as a result.
See #48.
v2.6.0
v2.5.2
What's Changed
- fix(table): keep external pointer aliases valid after saveAll inserts by @kalalannn in #46
New Contributors
- @kalalannn made their first contribution in #46
Full Changelog: v2.5.1...v2.5.2
v2.5.1
What's Changed
- fix: Iter yields all rows instead of only the first by @klaidliadon in #41
Full Changelog: v2.5.0...v2.5.1