-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite: move migration into into new() #517
base: main
Are you sure you want to change the base?
Conversation
b3828cb
to
16654b1
Compare
I've actually thought about going the other way with this and changing the redb to be in line with the sql one and force migrate to be called explicitly. My reasoning for this is it gives the user better control over db changes and allows them to create a backup before calling migrate. The other way we could handle this is create a backup before the migration, but do think we want to encourage or force a db backup before a migration. related: #400 |
Agree. If we give control to the caller over when to call A simpler and more robust way is IMO to encapsulate this in the DB initialization:
Then we can offer the methods
What do you think? |
Yes, you're right we should do it in the the DB initialization and create backups then. For the wallet especially I don't think we should create a backup each time as it uses more storage then is really needed but we can check if a migration is needed and back up then. For the mint a configurable number of backups should be fine. |
16654b1
to
5fcd888
Compare
73e2963
to
b917eea
Compare
51a3397
to
62fa29d
Compare
28da9fb
to
18a3705
Compare
18a3705
to
0f651b4
Compare
0f55037
to
90d853c
Compare
Description
This PR removes the need to call
migrate()
when a wallet or a mint uses SQLite.This is achieved with the same approach used in redb, where migration is handled inside
new()
.Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
Simplify SQLite integration: remove need to call
migrate()
ADDED
REMOVED
FIXED
Checklist
just final-check
before committing