Skip to content
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

Support for logical streaming replication #1271

Merged
merged 3 commits into from Apr 24, 2017
Merged

Support for logical streaming replication #1271

merged 3 commits into from Apr 24, 2017

Conversation

kibae
Copy link
Contributor

@kibae kibae commented Apr 20, 2017

Hello, @brianc @charmander

Please check the codes associated with this request. #1254
After merging, I will create a new project for logical replication.

Thanks

@@ -88,6 +89,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) + "'");
Copy link
Collaborator

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.

This is checking this.database === true, though – not this.replication === true. Is that really intended? I’m not sure why dbname='true' (not replication='true') would have any special meaning beyond a database named “true”.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry. I understand. You are right.
I'll change that code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this issue in last commit. Check please :)

@@ -88,6 +89,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
if(this.database) {
params.push("dbname='" + this.database + "'");
}
if(this.replication) {
params.push("replication='" + (this.replication === true ? "true" : this.replication) + "'");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since true stringifies to "true", this can be "replication='" + this.replication + "'".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I push the commit that accepted your advice :)

lib/client.js Outdated
@@ -222,6 +223,9 @@ Client.prototype.getStartupConf = function() {
if (appName) {
data.application_name = appName;
}
if (params.replication) {
data.replication = params.replication === true ? 'true' : params.replication;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly: '' + params.replication

Copy link
Collaborator

@charmander charmander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests might be requested, but these changes look right to me.

@kibae
Copy link
Contributor Author

kibae commented Apr 24, 2017

Hi @brianc ,
I'm almost ready! :)

https://github.com/kibae/pg-logical-replication

@brianc
Copy link
Owner

brianc commented Apr 24, 2017

@kibae I'm excited for you to get your module out into the wild!! Don't forget to add it to the wiki! I'll go ahead & push a minor version bump right now with the changes in this PR.

@brianc brianc merged commit 4f790de into brianc:master Apr 24, 2017
@brianc
Copy link
Owner

brianc commented Apr 24, 2017

published @ 6.2.0!

@kibae
Copy link
Contributor Author

kibae commented Apr 25, 2017

@brianc I changed dependencies of pg to 6.2.0
Did you publish 6.2.0 in npm? I got the message when install pg-logical-replication.
Thanks for kindly advise :)

npm ERR! notarget No compatible version found: pg@6.2.0
npm ERR! notarget Valid install targets:
npm ERR! notarget 6.1.5, 6.1.4, 6.1.3, 6.1.2, 6.1.1, 6.1.0, 6.0.4, 6.0.3, 6.0.2, 6.0.1, 6.0.0, 5.1.0, 5.0.0, 4.5.6, 4.5.5, 4.5.4, 4.5.3, 4.5.2, 4.5.1, 4.5.0, 4.4.6, 4.4.5, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.0, 4.2.0, 4.1.1, 4.1.0, 4.0.0, 4.0.0-beta2, 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.5.0, 3.4.5, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.0, 3.2.0, 3.1.0, 3.0.3, 3.0.2, 2.11.1, 2.11.0, 2.10.0, 2.9.0, 2.8.5, 2.8.4, 2.8.3, 2.8.2, 2.8.1, 2.8.0, 2.7.0, 2.6.2, 2.6.1, 2.6.0, 2.5.1, 2.5.0, 2.4.0, 2.3.1, 2.3.0, 2.2.0, 2.1.0, 2.0.0, 1.3.0, 1.2.0, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.15.1, 0.15.0, 0.14.1, 0.14.0, 0.13.3, 0.13.1, 0.13.0, 0.12.3, 0.12.1, 0.12.0, 0.11.3, 0.11.2, 0.11.1, 0.10.2, 0.10.0, 0.9.0, 0.8.8, 0.8.7, 0.8.6, 0.8.4, 0.8.3, 0.8.2, 0.8.1, 0.8.0, 0.7.2, 0.7.1, 0.7.0, 0.6.18, 0.6.17, 0.6.16, 0.6.15, 0.6.14, 0.6.13, 0.6.12, 0.6.11, 0.6.10, 0.6.9, 0.6.8, 0.6.7, 0.6.6, 0.6.5, 0.6.4, 0.6.3, 0.6.2, 0.6.1, 0.6.0, 0.5.8, 0.5.7, 0.5.6, 0.5.5, 0.5.4, 0.5.3, 0.5.2, 0.5.1, 0.5.0, 0.4.1

@kibae
Copy link
Contributor Author

kibae commented Apr 30, 2017

@brainc It looks like 6.1.5 in npm yet. Can you check it?
thanks :)

@kibae
Copy link
Contributor Author

kibae commented May 10, 2017

@brianc @charmander Please publish to npm 6.2.0~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants