pg: use native pgx for PostgreSQL storage - #1321
Draft
yyforyongyu wants to merge 9 commits into
Draft
Conversation
yyforyongyu
force-pushed
the
sql-wallet
branch
from
August 13, 2026 05:47
d9323bc to
2b0f2b1
Compare
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
force-pushed
the
task-native-pgx
branch
from
August 13, 2026 12:28
3aeb250 to
3c84710
Compare
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
commented
Aug 13, 2026
yyforyongyu
force-pushed
the
task-native-pgx
branch
2 times, most recently
from
August 13, 2026 15:46
bfe3fef to
acb5fd5
Compare
Add a driver-neutral nullable value for shared account rows and move SQL nullable conversions into each backend adapter. Preserve account creation and lookup behavior with focused tests.
Replace database/sql values in shared address rows with driver-neutral nullable values and timestamps. Convert PostgreSQL and SQLite rows at their adapter boundaries and retain address derivation coverage.
Replace shared UTXO nullable values with driver-neutral representations. Convert backend row types at the PostgreSQL and SQLite boundaries and cover invalid and absent block heights.
Move SQL query parameter construction into the PostgreSQL and SQLite adapters. Keep shared casting helpers driver-neutral while preserving range checks and nullable filter behavior.
Move no-row and connection sentinel handling into each SQL backend. Keep shared error normalization driver-neutral and retain domain-error, health, and classification behavior.
Define backend-neutral transaction operation and commit-result types. Keep ambiguity classification inside each backend so the shared runtime stays independent of driver transport errors.
Parameterize shared transaction execution over backend transaction and query types. Preserve begin, bind, commit, rollback, health, retry, and ambiguous-commit accounting for both SQL backends.
Name btcd v2 imports explicitly in changed PostgreSQL and SQLite files. This keeps tagged Docker lint deterministic without changing runtime behavior.
Generate PostgreSQL queries for pgx/v5, then run normal reads through pgxpool and writes through pgx.Tx. Adapt generated query values and row tests while retaining database/sql solely for migrations and tagged test administration.
yyforyongyu
force-pushed
the
task-native-pgx
branch
from
August 14, 2026 18:35
acb5fd5 to
f30a329
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use native pgx for normal PostgreSQL store reads, writes, and transactions
while keeping SQLite and migration tooling on
database/sql.Change Description
Implements roadmap Task 350
pgx/v5and adapt PostgreSQL values at thebackend boundary
health, fatal-error, rollback, and ambiguous-commit behavior
pool's
database/sqladapterStatus
This PR is deprioritized and is not currently being pursued. Please do not
review it.