Skip to content

wallet/sql: add SQL build foundation - #1287

Open
Roasbeef wants to merge 2 commits into
masterfrom
sql-port-stage1-foundation
Open

wallet/sql: add SQL build foundation#1287
Roasbeef wants to merge 2 commits into
masterfrom
sql-port-stage1-foundation

Conversation

@Roasbeef

Copy link
Copy Markdown
Member

In this PR, we add the SQL build foundation without routing any wallet operation through a new store or changing a public interface.

The source-history and attribution inventory lives separately in draft PR #1286. This PR is the first concrete cut and is based directly on master.

The change adds pinned sqlc tooling, generated-code checks, and the first SQLite and PostgreSQL schema slice for block metadata. The generated packages remain internal to the wallet, and both dialects use the same query contract.

This is the first Stage 1 PR in the port-first stack. It is intentionally limited to build support and block schema so later schema reviews can be evaluated independently from runtime and control-flow changes.

Verification:

  • make sqlc-check
  • go test ./wallet/internal/sql/...
  • no changes to wallet.Interface, waddrmgr, wtxmgr, or loader control flow

GustavoStingelin and others added 2 commits July 10, 2026 16:47
In this commit, we add sqlc to the repository tool image and wire deterministic generation into the Makefile and CI. This gives each schema PR a mechanical check that the generated Go query surface matches the SQL checked into the tree.

Extracted-from: e0666e0
Extracted-from: b6fbbb6
Extracted-from: 66cc4be
Extracted-from: bd468f6
In this commit, we add the first SQLite + PostgreSQL schema slice for the port-first wallet. The block table uses the chain height as its natural key, keeps the backend-specific byte types explicit, and generates the same query surface for both backends.

This lands only SQL assets and generated accessors. It does not route the wallet through a new store or change any public wallet API.

Extracted-from: f6e0258
Extracted-from: 3d67ecd
Extracted-from: e773de5
Extracted-from: 69e459b
Extracted-from: 594bb0d

Co-authored-by: Gustavo Stingelin <gustavo.stingelin@outlook.com>
Co-authored-by: yyforyongyu <yong2452@gmail.com>
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.

3 participants