refactor+graph/db: refactor preparations required for incoming SQL migration code#10011
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
NOTE: the itest flakes both unrelated and fixed in currently open PRs:
|
guggero
left a comment
There was a problem hiding this comment.
Just a nit, otherwise LGTM 🎉
So that we can use it in a context that only has access to a kvdb.Backend. We'll use this in our kvdb->SQL migration.
Create a forEachChannel function that does not rely on a KVStore being instantiated. We will use this in our upcoming kvdb->SQL migration.
Small refactor to introduce a re-usable getSourceNode function that we can then make use of in the upcoming kvdb->SQL migration logic.
Refactor channelIDToBytes to return a slice instead of an 8 byte array so that we dont need to use `[:]` everywhere. Also make sure we are using this helper everywhere.
In preparation for the kvdb->migration code, this commit updates `insertChannel` to return the ID of the newly inserted channel along with the IDs of the nodes that the channel links to.
ellemouton
left a comment
There was a problem hiding this comment.
thanks again for the speedy review yall! 🫡
|
cc @guggero for override 🙏
|
This PR is a pure refactor. It mainly just does some prep to make a couple of the kv store code re-useable so that we can call the code from the incoming SQL migration without needing to instantiate the entire
KVStorestruct.