Repository navigation
refactor!: replace sqlx with sqlite-thin - #22
Draft
notmandatory wants to merge 10 commits into
Draft
notmandatory wants to merge 10 commits into
notmandatory wants to merge 10 commits into
Conversation
Add a blocking Store (enabled by default) and an AsyncStore backed by a dedicated worker thread. Both features can be enabled at the same time. Migrations are embedded and tracked in a schema_migrations table; databases created by earlier sqlx-based releases are imported once from _sqlx_migrations so existing wallets are never re-migrated. Remove the sqlx dependency and all sqlx types from the public API.
Describe the new feature flags, the blocking Store default, the AsyncStore worker thread, and the one-time import of the legacy sqlx migration ledger. Add the 0.7.0 changelog entries.
Build every supported feature combination (blocking, async, wallet, and both stores together) and fail if sqlx references reappear.
Database failures now surface as Error::Database(DatabaseError), whose inner backend error is opaque. Internal conversions use a private InternalError type, so there is no public From<sqlite_thin::Error> impl. Remove Store::from_connection and Store::connection, and turn the public methods that took a &Connection into instance methods. AsyncStore::from_connection becomes internal. sqlite-thin can now change without altering bdk_sqlite's public type signatures.
The blocking example is now wallet (Store) and the async example is wallet_async (AsyncStore), matching the src module layout.
Adopt the same dual-license layout as bdk: a LICENSE pointer plus LICENSE-APACHE and LICENSE-MIT, matching the Cargo.toml license field.
Vendor bdk_testenv's persist_test_utils harness until it is published, and run its tx_graph, local_chain, and keychain_txout changeset checks against both Store and AsyncStore. Wallet-level cases (network, descriptors, full changesets) run through bdk_wallet's persist_test_utils. The multi-wallet case is omitted because this store holds a single wallet.
Replace the git dependency on sqlite-thin with the published 0.1.0-rc.0 release from crates.io, and point the README and CHANGELOG links at the crates.io page instead of the old CDK workspace path.
Document that sqlite-thin accepts any libsqlite3-sys >=0.28 and adopts whichever version the dependency graph selects, so bdk_sqlite can coexist with rusqlite (including bdk_wallet's rusqlite feature). Also describe how bundled vs. system SQLite is chosen and how to enable other libsqlite3-sys features such as SQLCipher.
notmandatory
marked this pull request as ready for review
December 4, 2026 03:47
notmandatory
marked this pull request as draft
December 4, 2026 04:21
3 tasks done
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.
Description
Add a blocking Store (enabled by default) and an AsyncStore backed by a dedicated worker thread. Both features can be enabled at the same time. Migrations are embedded and tracked in a schema_migrations table; databases created by earlier sqlx-based releases are imported once from _sqlx_migrations so existing wallets are never re-migrated. Remove the sqlx dependency and all sqlx types from the public API.
Notes to the reviewers
When the chain 0.24 based
bdk_testutilsrelease it includespersist_test_utilsfrom it. For now the code is copy pasted into this repo from bitcoindevkit/bdk#2012.My goal is to publish this refactor in a bdk_sqlite v0.7.0 release.