diff --git a/lib/client.js b/lib/client.js index 975eac66..5d1af39a 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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') { diff --git a/lib/defaults.js b/lib/defaults.js index e60c7437..8df164ca 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -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 }