From b832fd749ff0065c1684fec532564a611f757f4c Mon Sep 17 00:00:00 2001 From: github1337 Date: Mon, 16 Nov 2015 13:52:42 +0100 Subject: [PATCH] Updated adapter stream function --- lib/adapter.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/adapter.js b/lib/adapter.js index 84839a54..e8a3ed1e 100644 --- a/lib/adapter.js +++ b/lib/adapter.js @@ -904,7 +904,18 @@ module.exports = (function() { var tableName = collectionName; // Build find query - var query = sql.selectQuery(tableName, options); + var schema = connectionObject.schema; + var _query; + + var sequel = new Sequel(schema, sqlOptions); + + // Build a query for the specific query strategy + try { + _query = sequel.find(collectionName, options); + } catch(e) { + return cb(e); + } + var query = _query.query[0]; // Run query log('MySQL.stream: ', query);