All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- pg:
NoRollbackerror type to signal intentional transaction abort without triggering error-level logging.
- pg:
Tx.Savepointcallback now receivespg.Txinstead ofpg.Querier, enabling nested savepoints.
- worker: Generic task polling worker with concurrent processing, observability, and graceful shutdown.
The transaction API has been redesigned to make savepoints explicit
rather than implicit. Previously, WithTx detected a parent
transaction in the context and silently created a savepoint, which
made it hard to reason about whether you were getting a new
transaction or a savepoint. The new design separates the two
operations: WithTx always opens a fresh transaction, and savepoints
are created explicitly via Tx.Savepoint. This gives the type system
a role in enforcing transactional intent — Tx means "you're in a
transaction," Querier means "you can run queries," and the compiler
catches misuse rather than leaving it to runtime.
- pg:
Conninterface renamed toQuerier. All code referencingpg.Connmust be updated topg.Querier. - pg:
ExecFuncis now generic:ExecFunc[Q Querier].WithConnacceptsExecFunc[Querier],WithTxacceptsExecFunc[Tx]. - pg:
WithTxcallback now receivespg.Txinstead ofpg.Conn.TxextendsQuerierwith aSavepointmethod. - pg:
WithTxalways opens a new connection and transaction. It no longer implicitly creates savepoints via context detection. - pg: Removed
WithoutTx— no longer needed sinceWithTxalways starts a fresh transaction. - migrator:
Migration.Applynow takespg.Txinstead ofpg.Querierto make the transactional requirement explicit.
- pg:
Txinterface with explicitSavepoint(ctx, ExecFunc[Querier]) errormethod for creating savepoints within a transaction. - pg:
Querierinterface (renamed fromConn) representing the base capability of running SQL queries.
- pg:
ExecFuncsignature changed fromfunc(Conn) errortofunc(context.Context, Conn) error. All callbacks passed toWithConn,WithTx, andWithAdvisoryLockmust be updated to accept acontext.Contextas the first parameter. The provided context carries the active transaction, enabling savepoint support in nested calls.
- pg: Nested
WithTxcalls now create savepoints instead of independent transactions. If the inner callback fails, only the savepoint is rolled back; the outer transaction remains active. - pg:
WithoutTxfunction to obtain a context with the active transaction removed, useful when a nested call should start an independent transaction.
- Updated dependencies
- Fix trace export failed when attributes contains invalid UTF8 rune
0.1.0 - 2026-02-01
Initial release of the kit library.
- log: Structured logging wrapper around
slogwith OpenTelemetry trace correlation - pg: PostgreSQL client with connection pooling, transactions, advisory locks, and observability
- migrator: File-based SQL migration runner with version tracking
- httpserver: HTTP server with tracing, metrics, and response rendering helpers
- httpclient: HTTP client with pooled/non-pooled transports and telemetry
- worker: Generic worker pool with backpressure and graceful shutdown
- unit: Application lifecycle management with config loading, metrics server, and trace exporter