File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ var Client = function(config) {
2626 this . port = this . connectionParameters . port ;
2727 this . host = this . connectionParameters . host ;
2828 this . password = this . connectionParameters . password ;
29+ this . replication = this . connectionParameters . replication ;
2930
3031 var c = config || { } ;
3132
@@ -222,6 +223,9 @@ Client.prototype.getStartupConf = function() {
222223 if ( appName ) {
223224 data . application_name = appName ;
224225 }
226+ if ( params . replication ) {
227+ data . replication = '' + params . replication ;
228+ }
225229
226230 return data ;
227231} ;
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ var ConnectionParameters = function(config) {
5757 this . binary = val ( 'binary' , config ) ;
5858 this . ssl = typeof config . ssl === 'undefined' ? useSsl ( ) : config . ssl ;
5959 this . client_encoding = val ( "client_encoding" , config ) ;
60+ this . replication = val ( "replication" , config ) ;
6061 //a domain socket begins with '/'
6162 this . isDomainSocket = ( ! ( this . host || '' ) . indexOf ( '/' ) ) ;
6263
@@ -88,6 +89,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
8889 if ( this . database ) {
8990 params . push ( "dbname='" + this . database + "'" ) ;
9091 }
92+ if ( this . replication ) {
93+ params . push ( "replication='" + this . replication + "'" ) ;
94+ }
9195 if ( this . host ) {
9296 params . push ( "host=" + this . host ) ;
9397 }
Original file line number Diff line number Diff line change @@ -425,6 +425,9 @@ Connection.prototype.parseMessage = function(buffer) {
425425 case 0x48 : //H
426426 return this . parseH ( buffer , length ) ;
427427
428+ case 0x57 : //W
429+ return new Message ( 'replicationStart' , length ) ;
430+
428431 case 0x63 : //c
429432 return new Message ( 'copyDone' , length ) ;
430433
You can’t perform that action at this time.
0 commit comments