-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[12] graph/db: Implement more graph SQLStore methods #9936
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
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 (
|
@bhandras: review reminder |
01d561e
to
aeeee0e
Compare
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.
Very nice, LGTM 🎉
sqldb/sqlc/queries/graph.sql
Outdated
ON cp2.channel_id = c.id AND cp2.node_id = c.node_id_2 AND cp2.version = c.version | ||
WHERE c.version = sqlc.arg(version) | ||
AND (cp1.last_update >= sqlc.arg(start_time) AND cp1.last_update < sqlc.arg(end_time) | ||
OR cp2.last_update >= sqlc.arg(start_time) AND cp2.last_update < sqlc.arg(end_time)) |
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.
nit: use parenthesis around AND
clause to make precedence explicit for easier visual parsine.
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.
good idea! lemme know if the update looks ok
9ca966b
to
5670158
Compare
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.
Reviewed for my learning, left just one comment
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.
Looks good, just one last comment.
Add `ChanUpdatesInHorizon` method to the SQLStore. This lets us run `TestChanUpdatesInHorizon` against our SQL backends.
Ensure that the log line in `ChanUpdatesInHorizon` cannot cause a divide-by-zero panic.
So that we can have efficient lookups during the "*UpdatesInHorizon" calls.
Which let's us run `TestGraphTraversal` against our SQL backends.
This lets us run `TestFilterChannelRange` against the SQL backends.
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.
LGTM 🎉
} | ||
|
||
if len(edges) > 0 { | ||
log.Debugf("ChanUpdatesInHorizon hit percentage: %f (%d/%d)", |
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.
nit: if we're logging percentage, we should also multiply the result by 100. Also maybe worth fixing the precision to say %.2f
.
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.
cool, can do 👍 if it's ok, im gonna add this as a commit in the next PR so we can get this one in 👍 will make a note there
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.
added a commit here: #9971
Here, we implement:
Part of #9795
See #9932 for the full picture that we are aiming at