Closed
Description
Description
We could store a "database structure serial" in the db and check it every time it's loaded, to detect when the structure changes.
A good example of how database migrations can be done is in the database/sqlite
module. The goal of this issue is to add general support for any database module to update to a new structure when required.
Expected Outcomes
- Create a new trait and possibly structs in the database module to support database schema migration
- Implement or update database migration for the
keyvalue
andsqlite
modules - Any new public traits and structs should be documented
- New trait implementations should have basic unit tests
- Error if database schema version is > version in code (ie. using older code on database migrated with newer version)
Resources
Skills Required
- Experience with git. Guide
- Basic familiarity with rust. First seven chapters of the book
- Basic familiarity with SQL and JSON
- Familiarity with BDK’s keyvalue and sqlite database modules
Mentor(s)
@notmandatory
Difficulty
Medium
Competency Test
- Install rust, compile and run all bdk examples and tests.
- Read through the BDK docs.
- Make a dummy wallet with BDK with key-value and sqlite backends.
- Familiarity with basic rust, should be able to write basic custom trait implementations on foreign structures.