-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add DB subscription #114
Add DB subscription #114
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @richardhuaaa and the rest of your teammates on |
966eb8b
to
b342aa5
Compare
647b702
to
92f5ac8
Compare
a100969
to
4467348
Compare
4467348
to
db44f65
Compare
OR topic = @topic) | ||
AND (sqlc.narg('originator_node_id')::INT IS NULL | ||
OR originator_node_id = @originator_node_id) | ||
AND (sqlc.narg('originator_sequence_id')::BIGINT IS NULL |
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.
unrelated to the PR, but who generates the sequence ID?
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.
Great question - the originator does, this would be extracted from the originator_sid
field of UnsignedOriginatorEnvelope
proto.
As for how the originator allocates these ID's in the first place, it is created by the BIGSERIAL id
field of the staged_originator_envelope
table - so we're using a postgres sequence for this.
Adds a struct that can subscribe to changes in a database query, starting from some cursor onwards. Features:
Also adds a flexible DB query against the gateway_envelopes table that can query based on a range of params. Given the size of the query, I should add a unit test for it eventually.