File tree 3 files changed +11
-0
lines changed
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) {
26
26
this . port = this . connectionParameters . port ;
27
27
this . host = this . connectionParameters . host ;
28
28
this . password = this . connectionParameters . password ;
29
+ this . replication = this . connectionParameters . replication ;
29
30
30
31
var c = config || { } ;
31
32
@@ -222,6 +223,9 @@ Client.prototype.getStartupConf = function() {
222
223
if ( appName ) {
223
224
data . application_name = appName ;
224
225
}
226
+ if ( params . replication ) {
227
+ data . replication = '' + params . replication ;
228
+ }
225
229
226
230
return data ;
227
231
} ;
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ var ConnectionParameters = function(config) {
57
57
this . binary = val ( 'binary' , config ) ;
58
58
this . ssl = typeof config . ssl === 'undefined' ? useSsl ( ) : config . ssl ;
59
59
this . client_encoding = val ( "client_encoding" , config ) ;
60
+ this . replication = val ( "replication" , config ) ;
60
61
//a domain socket begins with '/'
61
62
this . isDomainSocket = ( ! ( this . host || '' ) . indexOf ( '/' ) ) ;
62
63
@@ -88,6 +89,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
88
89
if ( this . database ) {
89
90
params . push ( "dbname='" + this . database + "'" ) ;
90
91
}
92
+ if ( this . replication ) {
93
+ params . push ( "replication='" + this . replication + "'" ) ;
94
+ }
91
95
if ( this . host ) {
92
96
params . push ( "host=" + this . host ) ;
93
97
}
Original file line number Diff line number Diff line change @@ -425,6 +425,9 @@ Connection.prototype.parseMessage = function(buffer) {
425
425
case 0x48 : //H
426
426
return this . parseH ( buffer , length ) ;
427
427
428
+ case 0x57 : //W
429
+ return new Message ( 'replicationStart' , length ) ;
430
+
428
431
case 0x63 : //c
429
432
return new Message ( 'copyDone' , length ) ;
430
433
You can’t perform that action at this time.
0 commit comments