File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-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 === true ? 'true' : 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
@@ -82,6 +83,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
82
83
if ( this . database ) {
83
84
params . push ( "dbname='" + this . database + "'" ) ;
84
85
}
86
+ if ( this . replication ) {
87
+ params . push ( "replication='" + ( this . database === true ? "true" : this . replication ) + "'" ) ;
88
+ }
85
89
if ( this . host ) {
86
90
params . push ( "host=" + this . host ) ;
87
91
}
You can’t perform that action at this time.
0 commit comments