hapiest-mysql
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -131,3 +131,3 @@ 'use strict'; | ||
let sqlObject = | ||
Squel.update() | ||
Squel.update({parameterCharacter: '!!@@##$$%%'}) // See comment in _getBase for explanation of paramChar - using sequence likely never to be inserted | ||
.table(this._tableName) | ||
@@ -142,3 +142,3 @@ .setFields(cleanUpdateValues, {dontQuote: true}); | ||
let sqlObject = | ||
Squel.delete() | ||
Squel.delete({parameterCharacter: []}) // See comment in _getBase for explanation of paramChar | ||
.from(this._tableName); | ||
@@ -145,0 +145,0 @@ |
{ | ||
"name": "hapiest-mysql", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "A wrapper around mysql that provides a very descriptive way of running queries.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -142,2 +142,9 @@ 'use strict'; | ||
it('Should work even with ? in WHERE clause for one row', function() { | ||
const sql = mysqlDaoQueryHelper.updateOne({url: 'http://some.com/?blah=hello'}, {email: 'john.doe@gmail.com', firstName: 'john'}); | ||
Should.exist(sql); | ||
sql.should.eql("UPDATE users SET email = 'john.doe@gmail.com', first_name = 'john' WHERE (url = 'http://some.com/?blah=hello') LIMIT 1"); | ||
}); | ||
}); | ||
@@ -154,2 +161,9 @@ | ||
it('Should generate an DELETE statement even with ? in WHERE clause for one row', function() { | ||
const sql = mysqlDaoQueryHelper.deleteOne({url: 'http://some.com/?foo=bar'}); | ||
Should.exist(sql); | ||
sql.should.eql("DELETE FROM users WHERE (url = 'http://some.com/?foo=bar') LIMIT 1"); | ||
}); | ||
}); | ||
@@ -156,0 +170,0 @@ |
138720
3100