-
Notifications
You must be signed in to change notification settings - Fork 2.2k
sqldb/v2
as separate package
#10175
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
Open
ViktorTigerstrom
wants to merge
9
commits into
lightningnetwork:sqldb-v2
Choose a base branch
from
ViktorTigerstrom:2025-08-sqldb-v2-separate-package
base: sqldb-v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
sqldb/v2
as separate package
#10175
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
72f8639
sqldb/v2: add base for sqldb/v2 module
ViktorTigerstrom 212186b
sqldb/v2: move all non lnd-specific v1 code to v2
ViktorTigerstrom 1fcf9a0
sqldb/v2: introduce `MigrationStream`
ViktorTigerstrom 9c1df3d
sqldb/v2: Use `MigrationStream` for migrations
ViktorTigerstrom a1d3359
sqldb/v2: introduce sqldb/v2 `BaseDB`
ViktorTigerstrom fafd451
sqldb/v2: drop GetSchemaVersion & SetSchemaVersion
ViktorTigerstrom 88c1ffa
sqldb/v2: sync features with tapd's sqldb package
ViktorTigerstrom 53d4708
sqldb/v2: rename test db helper files
ViktorTigerstrom 233f1fb
lnd: add sqldb/v2 dependency to lnd
ViktorTigerstrom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok afaict, the big thing we added in the fork was the post migration call-backs logic.
Something id just like some clarity on before we push forward here is:
in our own rolled migration strategy in LND today that takes care of code migrations, we know that the migration version table will only be updated once the code migration is complete. Is the same true for the post-migration callback?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed this with guggero previously.
Currently, no that is not
true
unfortunately, as the version table will be updated if the SQL migration succeeds, while the code migration fails. But I'm planning to address that asap 🔥!The current plan is to submit a new PR to our migrate library fork. This PR will add a separate tracking table for code migrations. With this change, the logic will ensure that if the db is initialized and the persisted code migration version is lower than the SQL migration version, the code migration will be re-run prior to any SQL migration.
I haven't gotten to updating the migrate fork yet though. Perhaps we should hold of with merging this one until that change has been merged to the
migrate
fork, so that we don't need to push a new PR that updates the dependency inlnd
though.Does that sound like a good plan to you @ellemouton?