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) {
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 === true ? 'true' : 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
@@ -82,6 +83,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
8283 if ( this . database ) {
8384 params . push ( "dbname='" + this . database + "'" ) ;
8485 }
86+ if ( this . replication ) {
87+ params . push ( "replication='" + ( this . database === true ? "true" : this . replication ) + "'" ) ;
88+ }
8589 if ( this . host ) {
8690 params . push ( "host=" + this . host ) ;
8791 }
You can’t perform that action at this time.
0 commit comments