connection can be binary by default
if connection is created with config.binary = true, all queries get executed with binary result unless explicit disabled with binary = false
This commit is contained in:
parent
5d8c8bbcdc
commit
f8962fd036
@ -20,6 +20,7 @@ var Client = function(config) {
|
||||
this.connection = config.connection || new Connection({stream: config.stream});
|
||||
this.queryQueue = [];
|
||||
this.password = config.password || defaults.password;
|
||||
this.binary = config.binary || defaults.binary;
|
||||
this.encoding = 'utf8';
|
||||
this.processID = null;
|
||||
this.secretKey = null;
|
||||
@ -173,6 +174,9 @@ p._pulseQueryQueue = function() {
|
||||
p.query = function(config, values, callback) {
|
||||
//can take in strings or config objects
|
||||
config = (typeof(config) == 'string') ? { text: config } : config;
|
||||
if (this.binary && !('binary' in config)) {
|
||||
config.binary = true;
|
||||
}
|
||||
|
||||
if(values) {
|
||||
if(typeof values === 'function') {
|
||||
|
@ -14,5 +14,7 @@ module.exports = {
|
||||
//0 will disable connection pooling
|
||||
poolSize: 10,
|
||||
//duration of node-pool timeout
|
||||
poolIdleTimeout: 30000
|
||||
poolIdleTimeout: 30000,
|
||||
// binary result mode
|
||||
binary: false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user