-
BREAKING CHANGES:
- No longer supports Node versions prior to 8.12
query.exec
has now been removed my default and is no longer supported.
-
New: Added
query.eval([options])
andquery.then()
, which executes the query using a method defined onqueryize.evalFunction
and returns a promise -
Dependencies: Bluebird, proxmis and Lodash have been removed.
- Added support for INSERT IGNORE via the
insertIgnore
function.
-
BREAKING CHANGES:
- Now only supports Node 4 and later
- Removed
query.emitted()
- Removed
query.run()
alias forquery.exec()
query.exec()
now always uses theconnection.query
function instead ofconnection.execute
.
-
New: Casting a query object to a string now produces a query with escaped values.
-
Fixed:
query.clone()
will now properly clone all attributes. -
Dependencies:
- Replaced
lodash.assign
with ES6Object.assign
- Replaced
lodash.clone
withlodash.clonedeep
. - Updated
lodash.mapvalues
to 4.5.0 - Updated
proxmis
to 1.0.0 - Now using the
sqlstring
package to handle data escapement
- Replaced
-
Internal changes:
- Tests are now built using node-tap instead of nodeunit
- Library is now linted using eslint
- Fixed a bug that would create a malformed query when inserting or updating a null value.
- Date objects are now converted to MySQL DATETIME using the timezone on the date instead of always being UTC.
- Fixed a bug where using a raw subquery as a join target could lose part of the subquery.
- Added Multi-Insert Mode
- Causes Queryize to create insert queries in the format of
INSERT INTO table (columnA, columnB) VALUES (valueA, valueB)
, supporting multiple rows of data to be inserted. - Activated first time
query.addRow
is used.
- Causes Queryize to create insert queries in the format of
- Added support for REPLACE INTO queries via
query.replace()
as an alternative toquery.insert()
- Added support for passing raw query functions as
query.set()
values- Example: `query.set('dts', {raw:'NOW()'});
- Added
query.addColumn
to append extra columns outside of thequery.column
full set. - Fixed
query.set()
not properly overwriting a previously defined key/value pair. - INTERNAL: Query builders can now return a fully formed query object instead of a string.
- Added
query.emitted()
as an alternative toquery.exec()
.- node-mysql does not return a row emitter if a callback is provided. Since a callback is always provided as part of the promise extension, this made it impossible to receive a row emitter when using node-mysql (node-mysql2 does not have this limitation). This new function works around that limitation.
- Removed a console.log that slipped in.
- Added ability to provide a queryize object as a compound where condition.
- Added support for using queryize objects as subqueries in columns, joins and select from.
- Use
query.as(name)
to define the name for the subquery. If omitted, queryize will create a random name.
- Use
- Fixed bug in
query.debug()
that prevented it from enabling without passing true. - Added documentation examples for all possible ways you can use
query.exec()
- Major internal refactor to make the query object more externally extensible
- Query state is now stored on
this._attributes
instead of in a local variable. queryize.fn
now contains the prototype of the queryize query object. See lib/mutators.js for the contents.
- Query state is now stored on
- Added
query.clone()
to duplicate a query state inline - Changed
query.deleet()
toquery.delete()
- Switched to using lodash clone and assign functions instead of local versions.
- Added
query.disableBoundParameters
and deprecatedquery.useBoundParameters
- Fixed several V8 optimization killers
- Fixed bugs in
query.limit()
andquery.distinct()
- Fixed edge case in
query.where()
- Increased test coverage
- Improved documentation
- Added support for node-mysql2
connection.execute()
functions. Prefers overconnection.query()
query.exec()
now extends the node-mysql(2) query emitter object with.then()
and.catch()
, allowing use as a promise.- Lots and lots of new documentation in code
- Switched to using a custom dox based documentation generator
- Added Travis-CI testing
- Launched http://queryizejs.com
- Added
query.exec()
and deprecatedquery.run()
to be more consistent with other database libraries (eg, Mongoose)
- Fixed showstopper bug in
query.run()
- Changed query builders into a function map so that attributes is storing a name instead of a function. This makes it serializable and easier to duplicate.
- Added run() function as shortcut for node-mysql query command.
- Started documenting
- Initial release