This file is a manually maintained list of changes for each release. Feel free to add your changes here when sending pull requests. Also send corrections if you spot any mistakes.
- Updated documentation to reflect new Promise API support.
- Added Promise support. Closes #18. Thanks for the contribution @AbhijetPokhrel!
- Added new tests to verify that Promise support is working.
- Finally got testing working on Travis CI for MySQL and MSSQL.
- Changed the Query Builder instantiation syntax
- Passing an empty array to
where_in
andwhere_not_in
no longer throws an error (#34)
- Added mssql (t-sql) support using
tedious
as the underlying driver - Updated class files to use new ES6 class syntax for easier-maintainability
- Added new options:
**
pool_min
(minimum number of pooled connections (mssql
driver only)) **acquireTimeout
(milliseconds before a timeout occurs during the connection acquisition) - Added new query building method:
returning()
to allow for insert IDs to be returned. See docs for more info. - Added new tests
- retroactive fix of this change log
- updated the mysql escape string to use the proper mysql method.
- Updated package.json to always use the latest version of mysql 2.x
- Fixed a bug where you could not insert with leading zeros. #20
- Fixed a bug in how it's checking for valid connection types. Also updated tests to allow for an empty driver string in QueryBuilder constructor (defaults to 'mysql').
- Fixed a bug dealing with the default 'driver' param value in the QueryBuilder contructor
- Fixed a bug where non-strings or non-array-of-strings could be passed to the method and cause issues
- Updated codebase to ES6
- Fixed and documented the escape property of the
join
method.
- Added this history file
- Added the ability to do
SELECT DISTINCT
queries - We're doing better escaping of identifiers now
- Added the ability to use table/view prefixes directly (ex.
select * from users u
) - Added the ability to do
OR WHERE
statements withor_where()
method. - Added the ability to do
LIKE
statements directly (new methods:like()
,not_like()
,or_like()
,or_not_like()
) - Restored ability to do
WHERE IN(...)
statements by passing an array as the second param towhere()
- Added the ability to do
[OR] WHERE [NOT] IN(...)
statements directly (new methods:where_in()
,or_where_in()
,where_not_in()
,or_where_not_in()
) - Added the ability to do
FROM
statements directly forSELECT
andDELETE
queries (new method:from()
) (ex. db.from('foo').get(() => ...)) - Identifiers will now be properly escaped in
JOIN
statements. - Added the ability to call
get_where()
as a shorthand toget()
andwhere()
(ex.db.get_where('table',{foo: 'bar'},() => ...);
) - Added the ability to call
select_min()
,select_max()
,select_avg()
, andselect_sum()
. - Significanly improved security, helping to prevent SQL injection attacks.
- Added ability to do
OR HAVING
statements withor_having()
method - Added ability to add an offset directly without using the
limit()
method by using theoffset()
method. - Added ability to set
SET
values for updates and inserts using theset()
method. UPDATE
statements now supportORDER BY
clauses which can be added to the query using theorder_by()
method.- The
update()
method's 3rd parameter can now either be the callback (as always) or aWHERE
clause (ex. 'foo = "bar"' or {foo:'bar', id: 3}). If a where clause is provided, the callback is now the 4th parameter. This change is fully backwards-compatible with the previous version of this module. - New package dependencies (for testing): chai and mocha.
- Tests have been written for better-ensuring future enhancements and fixes to not break functionality
- Library has been broken into 3 objects to allow for prpoer testing. This won't affect the API and is fully-backwards compatible with the previous version.
- Officially announcing that how third parameter of the
where()
method works is deprecated... starting with v1.0.0, third param will be(bool) escape
and not(bool) isRaw
. So, all calls to this method using the 3rd parameter will, in future, have to be changed by convertingtrue
tofalse
and vice versa. This is so that we have a consistent API throughout the library. - Name officially changed to node-mysql-querybuilder.
- Author officially changed to Kyle Farris due to the substantial changes to this fork and Martin Tajur demoted to primary contributor (thanks for the great starting place Martin!!)
- Name of internal methods and properties have been normalized to use the "lower_case" syntax.
- Dependency for node-mysql upgraded to 2.5.
- travis-ci functionality added to repository
- Added public
escape()
method - Added funtional
update_batch()
method. - Added
truncate()
andempty_table()
methods.