Skip to content

refactor(db): introduce DBTX interface for query abstraction [1/2]#26

Open
rlindgren wants to merge 2 commits into
timescale:mainfrom
rlindgren:refactor/dbtx-interface
Open

refactor(db): introduce DBTX interface for query abstraction [1/2]#26
rlindgren wants to merge 2 commits into
timescale:mainfrom
rlindgren:refactor/dbtx-interface

Conversation

@rlindgren
Copy link
Copy Markdown

@rlindgren rlindgren commented Apr 24, 2026

Replace *pgxpool.Pool with a DBTX interface in all ~60 package-level db functions. DBTX is satisfied by both *pgxpool.Pool and pgx.Tx, following the sqlc convention. This enables future session variable scoping via SET LOCAL in transactions without changing callers.

Zero behavior change: all Client methods continue to pass c.pool, which satisfies DBTX. No new dependencies, no test changes required.

This PR is 1 of 2. It introduces the DBTX interface used by the session variable scoping in PR #27 which contains the complete description of the motivation, design and api changes

Replace *pgxpool.Pool with a DBTX interface in all ~60 package-level
db functions. DBTX is satisfied by both *pgxpool.Pool and pgx.Tx,
following the sqlc convention. This enables future session variable
scoping via SET LOCAL in transactions without changing callers.

Zero behavior change: all Client methods continue to pass c.pool,
which satisfies DBTX. No new dependencies, no test changes required.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 24, 2026

CLA assistant check
All committers have signed the CLA.

@rlindgren rlindgren changed the title refactor(db): introduce DBTX interface for query abstraction refactor(db): introduce DBTX interface for query abstraction [1/2] Apr 24, 2026
# Conflicts:
#	internal/tigerfs/db/query.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants