@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ## [ 0.3.0] - 2026-04-02
11+
12+ The transaction API has been redesigned to make savepoints explicit
13+ rather than implicit. Previously, ` WithTx ` detected a parent
14+ transaction in the context and silently created a savepoint, which
15+ made it hard to reason about whether you were getting a new
16+ transaction or a savepoint. The new design separates the two
17+ operations: ` WithTx ` always opens a fresh transaction, and savepoints
18+ are created explicitly via ` Tx.Savepoint ` . This gives the type system
19+ a role in enforcing transactional intent — ` Tx ` means "you're in a
20+ transaction," ` Querier ` means "you can run queries," and the compiler
21+ catches misuse rather than leaving it to runtime.
22+
23+ ### Breaking Changes
24+
25+ - ** pg** : ` Conn ` interface renamed to ` Querier ` . All code referencing ` pg.Conn ` must be updated to ` pg.Querier ` .
26+ - ** pg** : ` ExecFunc ` is now generic: ` ExecFunc[Q Querier] ` . ` WithConn ` accepts ` ExecFunc[Querier] ` , ` WithTx ` accepts ` ExecFunc[Tx] ` .
27+ - ** pg** : ` WithTx ` callback now receives ` pg.Tx ` instead of ` pg.Conn ` . ` Tx ` extends ` Querier ` with a ` Savepoint ` method.
28+ - ** pg** : ` WithTx ` always opens a new connection and transaction. It no longer implicitly creates savepoints via context detection.
29+ - ** pg** : Removed ` WithoutTx ` — no longer needed since ` WithTx ` always starts a fresh transaction.
30+ - ** migrator** : ` Migration.Apply ` now takes ` pg.Tx ` instead of ` pg.Querier ` to make the transactional requirement explicit.
31+
32+ ### Added
33+
34+ - ** pg** : ` Tx ` interface with explicit ` Savepoint(ctx, ExecFunc[Querier]) error ` method for creating savepoints within a transaction.
35+ - ** pg** : ` Querier ` interface (renamed from ` Conn ` ) representing the base capability of running SQL queries.
36+
1037## [ 0.2.0] - 2026-04-02
1138
1239### Breaking Changes
0 commit comments