-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support for logical streaming replication #1254
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
- Added WalStream class
# Conflicts: # test/test-walstream.js
@@ -82,6 +83,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) { | |||
if(this.database) { | |||
params.push("dbname='" + this.database + "'"); | |||
} | |||
if(this.replication) { | |||
params.push("replication='" + (this.database === true ? "true" : this.replication) + "'"); |
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.
Is this.database === true
intended to read this.replication
?
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 implemented pg_recvlogical's access method the same way.
The replication value can have a value of true or database.
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.
Oh, sorry. That's pipelinedb link..
please check this out :)
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.
So it’s intended to have:
{
database: true,
replication: 'truthy value',
}
resulting in:
[
"dbname='true'",
"replication='true'",
]
?
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.
"Replication" can have "database", "true" and "false" values.
For a clean commit log, I will just clean up the connection related code and request a new pull.
Let me know if you have a problem with my code. |
Hey @kibae - this is pretty awesome! Sorry for the delay. I'll merge this now! What I'm thinking of doing is pulling out the Walstream code into it's own module & only adding the things to node-postgres itself to support the replication. That way the Does that make sense? |
I'll wait for @charmander's approval - looks like there might be some |
@brianc Oh, I see. |
Hello,
Please check this code.
data
event for logical replication streamtest/test-walstream.js