Makes encoding an optional parameter
This commit is contained in:
parent
bbf945968e
commit
d69070529c
@ -38,6 +38,7 @@ var ConnectionParameters = function(config) {
|
||||
this.password = val('password', config);
|
||||
this.binary = val('binary', config);
|
||||
this.ssl = config.ssl || defaults.ssl;
|
||||
this.client_encoding = config.encoding || defaults.encoding;
|
||||
//a domain socket begins with '/'
|
||||
this.isDomainSocket = (!(this.host||'').indexOf('/'));
|
||||
};
|
||||
@ -61,7 +62,9 @@ ConnectionParameters.prototype.getLibpqConnectionString = function(cb) {
|
||||
params.push("host=" + this.host);
|
||||
return cb(null, params.join(' '));
|
||||
}
|
||||
params.push("client_encoding='utf-8'");
|
||||
if(this.client_encoding) {
|
||||
params.push(this.client_encoding);
|
||||
}
|
||||
dns.lookup(this.host, function(err, address) {
|
||||
if(err) return cb(err, null);
|
||||
params.push("hostaddr=" + address);
|
||||
|
@ -31,5 +31,7 @@ module.exports = {
|
||||
reapIntervalMillis: 1000,
|
||||
|
||||
//pool log function / boolean
|
||||
poolLog: false
|
||||
poolLog: false,
|
||||
|
||||
encoding: ""
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user