From a3fabc87d22530b45dd513149ad1666b8ad831e2 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 21 Sep 2015 20:51:08 -0600 Subject: [PATCH] fix find a little bit --- lib/dbwrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dbwrap.js b/lib/dbwrap.js index 874fa03..56a2d83 100644 --- a/lib/dbwrap.js +++ b/lib/dbwrap.js @@ -104,7 +104,7 @@ function wrap(db, dir) { if (i !== 0) { sql += 'AND '; } - sql += db.escape(snakeCase(key)) + ' ' + db.escape(opts[key]); + sql += db.escape(snakeCase(key)) + " = '" + db.escape(opts[key]) + "'"; }); if (params) { @@ -116,7 +116,7 @@ function wrap(db, dir) { } } - return db.allAsync("SELECT * FROM " + tablename + " " + sql, []).then(simpleMap); + return db.allAsync(sql, []).then(simpleMap); }; DB.get = function (id) {