Skip to content

Releases: goware/pgkit

v2.9.2

Choose a tag to compare

@klaidliadon klaidliadon released this 04 Aug 15:04
84d9eb3

This patch speeds up uniform batch inserts and restores generated values on multi-record inserts.

What's Changed

  • Speed up uniform-shape InsertRecords batches 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

Choose a tag to compare

@VojtechVitek VojtechVitek released this 31 Jul 14:52
494ee1b

What's Changed

Full Changelog: v2.9.0...v2.9.1

v2.9.0

Choose a tag to compare

@klaidliadon klaidliadon released this 03 Jul 11:23
d16cf8b

What's Changed

  • Table-mode cursor paginationTable.Mode selects how ListPaged paginates: PageBased (offset, the zero-value default) or CursorBased (keyset over IDColumn, forward-only, stable under concurrent writes). The first page takes direction from a supplied id-order (or a single id-column default sort); continuations feed Page.NextCursor back until empty.
  • Up-front page validationPage.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 returns ErrPageKindMismatch, a page carrying both returns ErrCursorPaged.
  • WithMode — plus Mode preserved across WithTx / WithPaginator.
  • Order.IsValid / Order.Sanitize — the Order type owns its validation and normalization; Page.SetDefaults tidied with cmp.Or.

Full Changelog: v2.8.0...v2.9.0

v2.8.0

Choose a tag to compare

@klaidliadon klaidliadon released this 11 Jun 10:48
24d355b

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

Choose a tag to compare

@klaidliadon klaidliadon released this 10 Jun 09:32
1fd3b2f

What's Changed

Full Changelog: v2.7.0...v2.7.1

v2.7.0

Choose a tag to compare

@klaidliadon klaidliadon released this 13 May 13:21
7f7dc8e

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 over pgx.ErrNoRows and sql.ErrNoRows
  • pgerr.IsUniqueViolation(err) (string, bool) — comma-ok, returns the constraint name when SQLSTATE is 23505
  • pgerr.IsFatal(err) bool — class-based retry/alert gate: classes 00/01/02/23 are non-fatal; every other class is fatal; non-PgError errors 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) *DB

Returns 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.

#49

v2.6.1

Choose a tag to compare

@klaidliadon klaidliadon released this 08 May 07:36
9597c0c

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

Choose a tag to compare

@VojtechVitek VojtechVitek released this 20 Apr 10:52
d1c465e

What's Changed

Full Changelog: v2.5.2...v2.6.0

v2.5.2

Choose a tag to compare

@VojtechVitek VojtechVitek released this 15 Apr 12:40
d63f505

What's Changed

  • fix(table): keep external pointer aliases valid after saveAll inserts by @kalalannn in #46

New Contributors

Full Changelog: v2.5.1...v2.5.2

v2.5.1

Choose a tag to compare

@klaidliadon klaidliadon released this 07 Apr 10:40
30bbcbe

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