UNPKG

40.7 kBMarkdownView Raw
1# Master (Unreleased)
2
3# 0.17.3 - 2 June, 2019
4
5### Typings
6
7- Improve typings for aggregations #3245
8- Add decimalNumbers to MySqlConnectionConfig interface #3244
9
10# 0.17.2 - 1 June, 2019
11
12### Typings
13
14- Improve count typings #3239
15
16### Bug fixes:
17
18- "colorette" dependency breaks browserify builds #3238
19
20# 0.17.1 - 31 May, 2019
21
22### New features:
23
24- Add migrate:down functionality #3228
25
26### Typings
27
28- Update type of aggregation results to not be arrays when first has been invoked before #3237
29- Include undefined in type of single row results #3231
30- Fix incorrect type definitions for single row queries #3230
31
32# 0.17.0 - 28 May, 2019
33
34### New features:
35
36- Add support for returning started transaction without immediately executing it #3099
37- Add support for passing transaction around with only starting it when needed #3099
38- Add clearHaving function #3141
39- Add --all flag for rollback in CLI #3187
40- Add error detail log to knex CLI #3149
41- Support multi-column whereIn in sqlite through values clause #3220
42- Allow users to specify the migrations "tableName" parameter via the CLI #3214
43- Unify object options handling for datetime/timestamp across dialects #3181
44- Add "up" command for migrations #3205
45
46### Typings
47
48- Add default values for generic types (fixes backwards compatibility broken by 0.16.6) #3189
49- Make function types generic in type definitions #3168
50- Add missing types to MigratorConfig #3174
51- Add types for havingBetween, orHavingBetween, havingNotBetween and orHavingNotBetween #3144
52- Update Knex.Config types to include log #3221
53- Fix some more cases of missing typings #3223
54- Support type safe refs #3215
55- Expose some utility types #3211
56- Fix issues with typings of joins and some conflicts with Bluebird typings #3209
57
58### Bug fixes:
59
60- Fix order of migration rollback #3172
61
62### Test / internal changes:
63
64- Execute CI tests on Node.js 12 #3171
65- Docker-based test dbs #3157
66- Use cli-testlab for testing CLI #3191
67
68# 0.16.5 - 11 Apr, 2019
69
70- Bundle polyfills with knex for 0.16.x line again #3139
71
72# 0.16.4 - 11 Apr, 2019
73
74### New features:
75
76- Boolean param for rollback() to rollback all migrations #2968
77- seed:run print the file name of the failing seed #2972 #2973
78- verbose option to CLI commands #2887
79- add intersect() #3023
80- Improved format for TS stubs #3080
81- MySQL: Support nullable timestamps #3100
82- MySQL: Warn `.returning()` does not have any effect #3039
83
84### Bug fixes:
85
86- Respect "loadExtensions" configuration #2969
87- Fix event listener duplication when using Migrator #2982
88- Fix fs-migrations breaking docs #3022
89- Fix sqlite3 drop/renameColumn() breaks with postProcessResponse #3040
90- Fix transaction support for migrations #3084
91- Fix queryContext not being passed to raw queries #3111
92- Typings: Allow to pass query builders, identifiers and raw in various places as parameters #2960
93- Typings: toNative() definition #2996
94- Typings: asCallback() definition #2963
95- Typings: queryContext() type definition Knex.Raw #3002
96- Typings: Add "constraintName" arg to primary() definition #3006
97- Typings: Add missing schemaName in MigratorConfig #3016
98- Typings: Add missing supported parameter types and toSQL method #2960
99- Typings: Update enum arguments to reflect latest signature #3043
100- Typings: Add size parameter to integer method #3074
101- Typings: Add 'string' as accepted Knex constructor type definition #3105
102- Typings: Add boolean as a column name in join #3121
103- Typings: Add missing clearOrder & clearCounters types #3109
104- Dependencies: Fix security warning #3082
105- Do not use unsupported column width/length arguments on data types int and tinyint in MSSQL #2738
106
107### Changes:
108
109- Make unionAll()'s call signature match union() #3055
110
111### Test / internal changes:
112
113- Swap chalk→colorette / minimist→getopts #2718
114- Always use well documented pg client query() config argument #3004
115- Do not bundle polyfills with knex #3024
116
117# 0.16.3 - 19 Dec, 2018
118
119### Bug fixes:
120
121- @babel/polyfill loaded multiple times #2955
122- Resolve migrations and seeds relatively to knexfile directory when specified (the way it used to be before 0.16.1) #2952
123
124# 0.16.2 - 10 Dec, 2018
125
126### Bug fixes:
127
128- Add TypeScript types to the "files" entry so they are properly included in the release #2943
129
130# 0.16.1 - 28 Nov, 2018
131
132### Breaking Changes:
133
134- Use datetime2 for MSSQL datetime + timestamp types. This change is incompatible with MSSQL older than 2008 #2757
135- Knex.VERSION() method was removed, run "require('knex/package').version" instead #2776
136- Knex transpilation now targets Node.js 6, meaning it will no longer run on older Node.js versions #2813
137- Add json type support for SQLite 3.9+ (tested to work with Node package 'sqlite3' 4.0.2+) #2814
138
139### New features:
140
141- Support passing explicit connection to query builder (#2817)
142- Introduced abstraction for getting migrations to make migration bundling easier #2775
143- Allow timestamp with timezone on mssql databases #2724
144- Allow specifying multiple migration directories #2735
145- Allow cloning query builder with .userParams({}) assigned to it #2802
146- Allow chaining of increment, decrement, and update #2740
147- Allow table names with `forUpdate`/`forShare` #2834
148- Added `whereColumn` and the associated `not` / `and` / `or` methods for using columns on the right side of a where clause #2837
149- Added `whereRecursive` method to make self-referential CTEs possible #2889
150- Added support for named unique, primary and foreign keys to SQLite3 #2840
151- Added support for generating new migration and seed files without knexfile #2884 #2905 #2935
152- Added support for multiple columns in `.orderBy()` #2881
153- Added option of `existingType` to `.enum()` method to support repeated use of enums #2719
154- Added option to pass `indexType` for MySQL dialect #2890
155- Added `onVal` and the associated `not` / `and` / `or` methods for using values in `on` clauses within joins #2746
156- Kill queries after timeout for PostgreSQL #2636
157- Manage TypeScript types internally #2845
158- Support 5.0.0+ versions of mssql driver #2861
159- Typescript migration stub #2816
160- Options object for passing timestamp parameters + regression tests #2919
161
162### Bug fixes:
163
164- Implement fail-fast logic for dialect resolution #2776
165- Fixed identifier wrapping for `using()`. Use columnize instead of wrap in using() #2713
166- Fix issues with warnPromise when migration does not return a promise #2730
167- Compile with before update so that bindings are put in correct order #2733
168- Fix join using builder withSchema #2744
169- Throw instead of process.exit when client module missing #2843
170- Display correct filename of a migration that failed #2910
171- Fixed support of knexSnakeCaseWrappers in migrations #2914
172- SQlite3 renameColunm quote fix #2833
173- Adjust typing for forUpdate()/forShare() variant with table names #2858
174- Fix execution of Oracle tests on Node 11 #2920
175- Fix failures in oracle test bench and added it back to mandatory CI tests #2924
176- Knex client knexfile resolution fix #2923
177- Add queryContext to type declarations #2931
178
179### Test / internal changes
180
181- Add tests for multiple union arguments with callbacks and builders #2749
182- Update dependencies #2772 #2810 #2842 #2848 #2893 #2904
183- Separate migration generator #2786
184- Do not postprocess internal queries in Migrator #2914 #2934
185- Use Babel 7 #2813
186- Introduce LGTM.com badge #2755
187- Cleanup based on analysis by https://lgtm.com #2870
188- Add test for retrieving null dates #2865
189- Add link to wiki #2866
190- Add tests for specifying explicit pg version #2895
191- Execute tests on Node.js 11 #2873
192- Version upgrade guide #2894
193
194# 0.16.0 - 27 Nov, 2018
195
196### Changes:
197
198- THIS RELEASE WAS UNPUBLISHED FROM NPM BECAUSE IT HAD BROKEN MIGRATIONS USING `postprocessResponse` FEATURE (#2644)
199
200# 0.15.2 - 19 Jul, 2018
201
202### Changes:
203
204- Rolled back changes introduced by #2542, in favor of opt-in behavior by adding a precision option in `date` / `timestamp` / `datetime` / `knex.fn.now` (#2715, #2721)
205
206# 0.15.1 - 12 Jul, 2018
207
208### Bug fixes:
209
210- Fix warning erroneously displayed for mysql #2705
211
212# 0.15.0 - 1 Jul, 2018
213
214### Breaking Changes:
215
216- Stop executing tests on Node 4 and 5. #2451 (not supported anymore)
217- `json` data type is no longer converted to `text` within a schema builder migration for MySQL databases (note that JSON data type is only supported for MySQL 5.7.8+) #2635
218- Removed WebSQL dialect #2461
219- Drop mariadb support #2681
220- Primary Key for Migration Lock Table #2569. This shouldn't affect to old loc tables, but if you like to have your locktable to have primary key, delete the old table and it will be recreated when migrations are ran next time.
221- Ensure knex.destroy() returns a bluebird promise #2589
222- Increment floats #2614
223- Testing removal of 'skim' #2520, Now rows are not converted to plain js objects, returned row objects might have changed type with oracle, mssql, mysql and sqlite3
224- Drop support for strong-oracle #2487
225- Timeout errors doesn't silently ignore the passed errors anymore #2626
226- Removed WebSQL dialect #2647
227- Various fixes to mssql dialect to make it compatible with other dialects #2653, Unique constraint now allow multiple null values, float type is now float instaed of decimal, rolling back transaction with undefined rejects with Error, select for update and select for share actually locks selected row, so basically old schema migrations will work a lot different and produce different schema like before. Also now MSSQL is included in CI tests.
228
229### Bug fixes:
230
231- Fixes onIn with empty values array #2513
232- fix wrapIdentifier not being called in postgres alter column #2612
233- fixes wrapIdentifier to work with postgres `returning` statement 2630 #2642
234- Fix mssql driver crashing in certain cases when conneciton is closed unexpectedly #2637
235- Removed semicolon from rollback stmt for oracle #2564
236- Make the stream catch errors in the query #2638
237
238### New Features:
239
240- Create timestamp columns with microsecond precision on MySQL 5.6 and newer #2542
241- Allow storing stacktrace, where builder is initialized to be able trace back where certain query was created #2500 #2505
242- Added 'ref' function #2509, no need for knex.raw('??', ['id']) anymore, one can do knex.ref('id')
243- Support postgresql connection uri protocol #2609
244- Add support for native enums on Postgres #2632
245- Allow overwriting log functions #2625
246
247### Test / internal changes
248
249- chore: cache node_modules #2595
250- Remove babel-plugin-lodash #2634
251- Remove readable-stream and safe-buffer #2640
252- chore: add Node.js 10 #2594
253- add homepage field to package.json #2650
254
255# 0.14.6 - 12 Apr, 2018
256
257### Bug fixes:
258
259- Restored functionality of query event #2566 (#2549)
260
261# 0.14.5 - 8 Apr, 2018
262
263### Bug fixes:
264
265- Fix wrapping returning column on oracledb #2554
266
267### New Features:
268
269- Support passing DB schema name for migrations #2499 #2559
270- add clearOrder method #2360 #2553
271- Added knexTxId to query events and debug calls #2476
272- Support multi-column `whereIn` with query #1390
273- Added error if chaining update/insert/etc with first() #2506
274- Checks for an empty, undefined or null object on transacting #2494
275- countDistinct with multiple columns #2449
276
277### Test / internal changes
278
279- Added npm run test:oracledb command that runs oracledb tests in docker #2491
280- Runnin mssql tests in docker #2496
281- Update dependencies #2561
282
283# 0.14.4 - 19 Feb, 2018
284
285### Bug fixes:
286
287- containsUndefined only validate plain objects. Fixes #1898 (#2468)
288- Add warning when using .returning() in sqlite3. Fixes #1660 (#2471)
289- Throw an error if .update() results in an empty sql (#2472)
290- Removed unnecessary createTableIfNotExist and replaced with createTable (#2473)
291
292### New Features:
293
294- Allow calling lock procedures (such as forUpdate) outside of transaction. Fixes #2403. (#2475)
295- Added test and documentation for Event 'start' (#2488)
296
297### Test / internal changes
298
299- Added stress test, which uses TCP proxy to simulate flaky connection #2460
300- Removed old docker tests, new stress test setup (#2474)
301- Removed unused property \_\_cid on the base client (#2481)
302- Changed rm to rimraf in 'npm run dev' (#2483)
303- Changed babel preset and use latest node as target when running dev (#2484)
304
305# 0.14.3 - 8 Feb, 2018
306
307### Bug fixes:
308
309- Use tarn as pool instead of generic-pool which has been given various problems #2450
310- Fixed mysql issue where add columns failed if using both after and collate #2432
311- CLI sets exit-code 1 if the command supplied was not parseable #2358
312- Set toNative() to be not enumerable #2388
313- Use wrapIdentifier in columnInfo. fixes #2402 #2405
314- Fixed a bug when using .returning (OUTPUT) in an update query with joins in MSSQL #2399
315- Better error message when running migrations fail before even starting run migrations #2373
316- Read oracle's UV_THREADPOOL_SIZE env variable correctly #2372
317- Added decimal variable precision / scale support #2353
318
319### New Features:
320
321- Added queryContext to schema and query builders #2314
322- Added redshift dialect #2233
323- Added warning when one uses .createTableIfNotExist and deprecated it from docs #2458
324
325### Test / internal changes
326
327- Update dependencies and fix ESLint warnings accordingly #2433
328- Disable oracledb tests from non LTS nodes #2407
329- Update dependencies #2422
330
331# 0.14.2 - 24 Nov, 2017
332
333### Bug fixes:
334
335- Fix sqlite3 truncate method to work again #2348
336
337# 0.14.1 - 19 Nov, 2017
338
339### Bug fixes:
340
341- Fix support for multiple schema names in in postgres `searchPath` #2340
342- Fix create new connection to pass errors to query instead of retry loop #2336
343- Fix recognition of connections closed by server #2341
344
345# 0.14.0 - 6 Nov, 2017
346
347### Breaking Changes:
348
349- Remove sorting of statements from update queries #2171
350- Updated allowed operator list with some missing operators and make all to lower case #2239
351- Use node-mssql 4.0.0 #2029
352- Support for enum columns to SQlite3 dialect #2055
353- Better identifier quoting in Sqlite3 #2087
354- Migration Errors - Display filename of of failed migration #2272
355
356### Other Features:
357
358- Post processing hook for query result #2261
359- Build native SQL where binding parameters are dialect specific #2237
360- Configuration option to allow override identifier wrapping #2217
361- Implemented select syntax: select({ alias: 'column' }) #2227
362- Allows to filter seeds and migrations by extensions #2168
363- Reconnecting after database server disconnect/reconnect + tests #2017
364- Removed filering from allowed configuration settings of mysql2 #2040
365- Allow raw expressions in query builder aggregate methods #2257
366- Throw error on non-string table comment #2126
367- Support for mysql stream query options #2301
368
369### Bug fixes:
370
371- Allow update queries and passing query builder to with statements #2298
372- Fix escape table name in SQLite columnInfo call #2281
373- Preventing containsUndefined from going to recursion loop #1711
374- Fix error caused by call to knex.migrate.currentVersion #2123
375- Upgraded generic-pool to 3.1.7 (did resolve some memory issues) #2208
376- Allow using NOT ILIKE operator #2195
377- Fix postgres searchPath to be case-sensitive #2172
378- Fix drop of multiple columns in sqlite3 #2107
379- Fix adding multiple columns in Oracle #2115
380- Use selected schema when dropping indices in Postgres. #2105
381- Fix hasTable for MySQL to not do partial matches #2097
382- Fix setting autoTransaction in batchInsert #2113
383- Fix connection error propagation when streaming #2199
384- Fix comments not being applied to increments columns #2243
385- Fix mssql wrong binding order of queries that combine a limit with select raw or update #2066
386- Fixed mysql alter table attributes order #2062
387
388### Test / internal changes
389
390- Update each out-of-date dependency according to david-dm.org #2297
391- Update v8flags to version 3.0.0 #2288
392- Update interpret version #2283
393- Fix debug output typo #2187
394- Docker CI tests #2164
395- Unit test for right/rightOuterJoin combination #2117
396- Unit test for fullOuterJoin #2118
397- Unit tests for table comment #2098
398- Test referencing non-existent column with sqlite3 #2104
399- Unit test for renaming column in postgresql #2099
400- Unit test for cross-join #2102
401- Fix incorrect parameter name #2068
402
403# 0.13.0 - 29 Apr, 2017
404
405### Breaking Changes:
406
407- Multiple concurrent migration runners blocks instead of throwing error when possible #1962
408- Fixed transaction promise mutation issue #1991
409
410### Other Changes:
411
412- Allow passing version of connected db in configuration file #1993
413- Bugfixes on batchInsert and transactions for mysql/maria #1992
414- Add fetchAsString optional parameter to oracledb dialect #1998
415- fix: escapeObject parameter order for Postgres dialect. #2003
416
417# 0.12.9 - 23 Mar, 2017
418
419- Fixed unhandled exception in batchInsert when the rows to be inserted resulted in duplicate key violation #1880
420
421# 0.12.8 - 15 Mar, 2017
422
423- Added clearSelect and clearWhere to query builder #1912
424- Properly close Postgres query streams on error #1935
425- Transactions should never reject with undefined #1970
426- Clear acquireConnectionTimeout if an error occurs when acquiring a connection #1973
427
428# 0.12.7 - 17 Feb, 2017
429
430### Accidental Breaking Change:
431
432- Ensure that 'client' is provided in knex config object #1822
433
434### Other Changes:
435
436- Support custom foreign key names #1311, #1726
437- Fixed named bindings to work with queries containing `:`-chars #1890
438- Exposed more promise functions #1896
439- Pass rollback errors to transaction promise in mssql #1885
440- ONLY keyword support for PostgreSQL (for table inheritance) #1874
441- Fixed Mssql update with join syntax #1777
442- Replace migrations and seed for react-native packager #1813
443- Support knexfile, migration and seeds in TypeScript #1769
444- Fix float to integer conversion of decimal fields in MSSQL #1781
445- External authentication capability when using oracledb driver #1716
446- Fixed MSSQL incorect query build when locks are used #1707
447- Allow to use `first` method as aliased select #1784
448- Alter column for nullability, type and default value #46, #1759
449- Add more having* methods / join clause on* methods #1674
450- Compatibility fixes and cleanups #1788, #1792, #1794, #1814, #1857, #1649
451
452# 0.12.6 - 19 Oct, 2016
453
454- Address warnings mentioned in #1388 (#1740)
455- Remove postinstall script (#1746)
456
457# 0.12.5 - 12 Oct, 2016
458
459- Fix broken 0.12.4 build (removed from npm)
460- Fix #1733, #920, incorrect postgres array bindings
461
462# 0.12.3 - 9 Oct, 2016
463
464- Fix #1703, #1694 - connections should be returned to pool if acquireConnectionTimeout is triggered
465- Fix #1710 regression in postgres array escaping
466
467# 0.12.2 - 27 Sep, 2016
468
469- Restore pool min: 1 for sqlite3, #1701
470- Fix for connection error after it's closed / released, #1691
471- Fix oracle prefetchRowCount setting, #1675
472
473# 0.12.1 - 16 Sep, 2016
474
475- Fix MSSQL sql execution error, #1669
476- Added DEBUG=knex:bindings for debugging query bindings, #1557
477
478# 0.12.0 - 13 Sep, 2016
479
480- Remove build / built files, #1616
481- Upgrade to Babel 6, #1617
482- Reference Bluebird module directly, remove deprecated .exec method, #1618
483- Remove documentation files from main repo
484- Fix broken behavior on WebSQL build, #1638
485- Oracle id sequence now handles manual inserts, #906
486- Cleanup PG escaping, fix #1602, #1548
487- Added [`with`](#Builder-with) to builder for [common table expressions](https://www.postgresql.org/docs/9.4/static/queries-with.html), #1599
488- Fix #1619, pluck with explicit column names
489- Switching back to [generic-pool](https://github.com/coopernurse/node-pool) for pooling resource management
490- Removed index.html, please direct all PR's for docs against the files in [knex/documentation](https://github.com/knex/documentation)
491
492# 0.11.10 - 9 Aug, 2016
493
494- Added CHANGELOG.md for a [new documentation](https://github.com/knex/documentation) builder coming soon, #1615
495- Minor documentation tweaks
496- PG: Fix Uint8Array being considered undefined, #1601
497- MSSQL: Make columnInfo schema dynamic, #1585
498
499# 0.11.9 - 21 Jul, 2016
500
501- Reverted knex client breaking change (commit b74cd69e906), fixes #1587
502
503# 0.11.8 - 21 Jul, 2016
504
505- Oracledb dialect #990
506- Documentation fix #1532
507- Allow named bindings to be escaped. #1576
508- Several bugs with MS SQL schema creation and installing from gihub fix #1577
509- Fix incorrect escaping of backslashes in SqlString.escape #1545
510
511# 0.11.7 - 19 Jun, 2016
512
513- Add missing dependency. #1516
514
515# 0.11.6 - 18 Jun, 2016
516
517- Allow cancellation on timeout (MySQL) #1454
518- Better bigint support. (MSSQL) #1445
519- More consistent handling of `undefined` values in `QueryBuilder#where` and `Raw`. #1459
520- Fix Webpack build. #1447
521- Fix code that triggered Bluebird warnings. #1460, #1489
522- Fix `ping` function. (Oracle) #1486
523- Fix `columnInfo`. (MSSQL) #1464
524- Fix `ColumnCompiler#binary`. (MSSQL) #1464
525- Allow connection strings that do not contain a password. #1473
526- Fix race condition in seed stubs. #1493
527- Give each query a UUID. #1510
528
529# 0.11.5 - 26 May, 2016
530
531- Bugfix: Using `Raw` or `QueryBuilder` as a binding to `Raw` now works as intended
532
533# 0.11.4 - 22 May, 2016
534
535- Bugfix: Inconsistency of `.primary()` and `.dropPrimary()` between dialects #1430
536- Feature: Allow using custom Client/Dialect (you can pass your own client in knex config) #1428
537- Docs: Add documentation for .dropTimestamps #1432
538- Bugfix: Fixed passing undefined fields for insert/update inside transaction #1423
539- Feature: `batchInsert` with existing transaction #1354
540- Build: eslint instead of jshint #1416
541- Bugfix: Pooled connections not releasing #1382
542- Bugfix: Support passing `knex.raw` to `.whereNot` #1402
543- Docs: Fixed list of dialects which supports `.returning` #1398
544- Bugfix: rename table does not fail anymore even with schema defined #1403
545
546# 0.11.3 - 14 May, 2016
547
548- Support nested joins. #1397
549
550# 0.11.2 - 14 May, 2016
551
552- Prevent crash on `knex seed:make`. #1389
553- Improvements to `batchInsert`. #1391
554- Improvements to inserting `DEFAULT` with `undefined` binding. #1396
555- Correct generated code for adding/dropping multiple columns. (MSSQL) #1401
556
557# 0.11.1 - 6 May, 2016
558
559- Fix error in CLI command `migrate:make`. #1386
560
561# 0.11.0 - 5 May, 2016
562
563### Breaking Changes:
564
565- `QueryBuilder#orWhere` joins multiple arguments with `AND`. #1164
566
567### Other Changes:
568
569- Collate for columns. (MySQL) #1147
570- Add `QueryBuilder#timeout`, `Raw#timeout`. #1201 #1260
571- Exit with error code when appropriate. #1238
572- MSSQL connection accepts `host` as an alias for `server` in accordance with other dialects. #1239
573- Add `query-response` event. #1231
574- Correct behaviour of sibling nested transactions. #1226
575- Support `RETURNING` with `UPDATE`. (Oracle) #1253
576- Throwing callbacks from transactions automatically rolls them back. #1257
577- Fixes to named `Raw` bindings. #1251
578- `timestamps` accepts an argument to set `NOT NULL` and default to current timestamp.
579- Add `TableBuilder#inherits` for PostgreSQL. #601
580- Wrap index names. #1289
581- Restore coffeescript knexfiles and configurations. #1292
582- Add `andWhereBetween` and `andWhereNotBetween` #1132
583- Fix `valueForUndefined` failure. #1269
584- `renameColumn` no longer drops default value or nullability. #1326
585- Correct MySQL2 error handling. #1315
586- Fix MSSQL `createTableIfNotExists`. #1362
587- Fix MSSQL URL parsing. #1342
588- Update Lodash to 4.6.0 #1242
589- Update Bluebird to 3.3.4 #1279
590
591# 0.10.0 - 15 Feb, 2016
592
593### Breaking Changes:
594
595- `insert` and `update` now ignore `undefined` values. Back compatibility is provided through the option `useNullAsDefault`. #1174, #1043
596
597### Other Changes:
598
599- Add [`countDistinct`](#Builder-countDistinct), [`avgDistinct`](#Builder-avgDistinct) and [`sumDistinct`](#Builder-sumDistinct). #1046
600- Add [`schema.jsonb`](#Schema-jsonb). Deprecated `schema.json(column, true)`. #991
601- Support binding identifiers with `??`. #1103
602- Restore `query` event when triggered by transactions. #855
603- Correct question mark escaping in rendered queries. #519, #1058
604- Add per-dialect escaping, allowing quotes to be escaped correctly. #886, #1095
605- Add MSSQL support. #1090
606- Add migration locking. #1094
607- Allow column aliases to contain `.`. #1181
608- Add `batchInsert`. #1182
609- Support non-array arguments to [`knex.raw`](#Raw-Bindings).
610- Global `query-error` event. #1163
611- Add `batchInsert`. #1182
612- Better support for Mysql2 dialect options. #980
613- Support for `acquireConnectionTimeout` default 60 seconds preventing #1040 from happening. #1177
614- Fixed constraint name escaping when dropping a constraint. #1177
615- Show also `.raw` queries in debug output. #1169
616- Support for `cli` to use basic configuration without specific environment set. #1101
617
618# 0.9.0 - Nov 2, 2015
619
620- Fix error when merging `knex.raw` instances without arguments. #853
621- Fix error that caused the connection to time out while streaming. #849
622- Correctly parse SSL query parameter for PostgreSQL. #852
623- Pass `compress` option to MySQL2. #843
624- Schema: Use `timestamp with timezone` by default for `time`, `datetime` and `timestamp` for Oracle. #876
625- Add [`QueryBuilder#modify`](#Builder-modify) #881
626- Add LiveScript and Early Gray support for seeds and migrations.
627- Add [`QueryBuilder#withSchema`](#Builder-withSchema) #518
628- Allow escaping of `?` in `knex.raw` queries. #946
629- Allow `0` in join clause. #953
630- Add migration config to allow disabling/enabling transactions per migration. #834
631
632# 0.8.6 - May 20, 2015
633
634- Fix for several transaction / migration issues, #832, #833, #834, #835
635
636# 0.8.5 - May 14, 2015
637
638- Pool should be initialized if no pool options are specified
639
640# 0.8.4 - May 13, 2015
641
642- Pool should not be initialized if {max: 0} is sent in config options
643
644# 0.8.3 - May 2, 2015
645
646- Alias postgresql -> postgres in connection config options
647
648# 0.8.2 - May 1, 2015
649
650- Fix regression in using query string in connection config
651
652# 0.8.1 - May 1, 2015
653
654- Warn rather than error when implicit commits wipe out savepoints in mysql / mariadb, #805.
655- Fix for incorrect seed config reference, #804
656
657# 0.8.0 - Apr 30, 2015
658
659### New Features:
660
661- Fixes several major outstanding bugs with the connection pool, switching to [Pool2](https://github.com/myndzi/pool2) in place of generic-pool-redux
662- strong-oracle module support
663- Nested transactions automatically become savepoints, with `commit` & `rollback` releasing or rolling back the current savepoint.
664- Database seed file support, #391
665- Improved support for sub-raw queries within raw statements
666- Migrations are now wrapped in transactions where possible
667- Subqueries supported in insert statements, #627
668- Support for nested having, #572
669- Support object syntax for joins, similar to "where" #743
670
671### Major Changes:
672
673- Transactions are immediately invoked as A+ promises, #470 (this is a feature and should not actually break anything in practice)
674- Heavy refactoring internal APIs (public APIs should not be affected)
675
676### "Other Changes:
677
678- Allow mysql2 to use non-default port, #588
679- Support creating & dropping extensions in PostgreSQL, #540
680- CLI support for knexfiles that do not provide environment keys, #527
681- Added sqlite3 dialect version of whereRaw/andWhereRaw (#477)
682
683# 0.7.5 - Mar 9, 2015
684
685- Fix bug in validateMigrationList, (#697)
686
687# 0.7.4 - Feb 25, 2015
688
689- Fix incorrect order of query parameters when using subqueries, #704
690- Properly handle limit 0, (#655)
691- Apply promise args from then instead of [explicitly passing](https://github.com/petkaantonov/bluebird/issues/482).
692- Respect union parameter as last argument (#660).
693- Added sqlite3 dialect version of whereRaw/andWhereRaw (#477).
694- Fix SQLite dropColumn doesn't work for last column (#544).
695- Add POSIX operator support for Postgres (#562)
696- Sample seed files now correctly (#391)
697
698# 0.7.3 - Oct 3, 2014
699
700- Support for `join(table, rawOrBuilder)` syntax.
701- Fix for regression in PostgreSQL connection (#516)
702
703# 0.7.2 - Oct 1, 2014
704
705- Fix for regression in migrations
706
707# 0.7.1 - Oct 1, 2014
708
709- Better disconnect handling & pool removal for MySQL clients, #452
710
711# 0.7.0 - Oct 1, 2014
712
713### New Features
714
715- Oracle support, #419
716- Database seed file support, #391
717- Improved support for sub-raw queries within raw statements
718
719### Breaking Changes
720
721- "collate nocase" no longer used by default in sqlite3 #396
722
723### Other Changes
724
725- Bumping Bluebird to ^2.x
726- Transactions in websql are now a no-op (unsupported) #375
727- Improved test suite
728- knex.fn namespace as function helper (knex.fn.now), #372
729- Better handling of disconnect errors
730- Support for offset without limit, #446
731- Chainable first method for mysql schema, #406
732- Support for empty array in `whereIn`
733- Create/drop schema for postgres, #511
734- Inserting multiple rows with default values, #468
735- Join columns are optional for cross-join, #508
736- Flag for creating jsonb columns in Postgresql, #500
737
738# 0.6.22 - July 10, 2014
739
740- Bug fix for properly binding postgresql streaming queries, (#363)
741
742# 0.6.21 - July 9, 2014
743
744- Bug fix for raw queries not being transaction context aware, (#351).
745- Properly forward stream errors in sqlite3 runner, (#359)
746
747# 0.6.20 - June 30, 2014
748
749- Allow case insensitive operators in sql clauses, (#344)
750
751# 0.6.19 - June 27, 2014
752
753- Add `groupByRaw` / `orderByRaw` methods, better support for raw statements in group / order (#282).
754- Support more config options for node-mysql2 dialect (#341).
755- CLI help text fix, (#342)
756
757# 0.6.18 - June 25, 2014
758
759- Patch for the method, calling without a handler should return the stream, not a promise (#337)
760
761# 0.6.17 - June 23, 2014
762
763- Adding missing map / reduce proxies to bluebird's implementation
764
765# 0.6.16 - June 18, 2014
766
767- Increment / decrement returns the number of affectedRows (#330).
768- Allow --cwd option flag to be passed to CLI tool (#326)
769
770# 0.6.15 - June 14, 2014
771
772- Added the as method for aliasing subqueries
773
774# 0.6.14 - June 14, 2014
775
776- whereExists / whereNotExists may now take a query builder instance as well as a callback
777
778# 0.6.13 - June 12, 2014
779
780- Fix regression with onUpdate / onDelete in PostgreSQL, (#308).
781- Add missing `Promise` require to knex.js, unit test for knex.destroy (#314)
782
783# 0.6.12 - June 10, 2014
784
785- Fix for regression with boolean default types in PostgreSQL
786
787# 0.6.11 - June 10, 2014
788
789- Fix for regression with queries containing multiple order by statements in sqlite3
790
791# 0.6.10 - June 10, 2014
792
793- Fix for big regression in memoization of column names from 0.5 -> 0.6
794
795# 0.6.9 - June 9, 2014
796
797- Fix for regression in specificType method
798
799# 0.6.8 - June 9, 2014
800
801- Package.json fix for CLI
802
803# 0.6.7 - June 9, 2014
804
805- Adds support for [node-mysql2](https://github.com/sidorares/node-mysql2) library.
806- Bundles CLI with the knex install, various related migrate CLI fixes
807
808# 0.6.6 - June 9, 2014
809
810- console.warn rather than throw when adding foreignKeys in SQLite3.
811- Add support for dropColumn in SQLite3.
812- Document `raw.wrap`
813
814# 0.6.5 - June 9, 2014
815
816- Add missing \_ require to WebSQL builds
817
818# 0.6.4 - June 9, 2014
819
820- Fix & document schema.raw method
821
822# 0.6.3 - June 6, 2014
823
824- Schema methods on transaction object are now transaction aware (#301).
825- Fix for resolved value from transactions, (#298).
826- Undefined columns are not added to builder
827
828# 0.6.2 - June 4, 2014
829
830- Fix regression in raw query output, (#297).
831- Fix regression in "pluck" method (#296).
832- Document [first](#Builder-first) method
833
834# 0.6.1 - June 4, 2014
835
836- Reverting to using .npmignore, the "files" syntax forgot the knex.js file
837
838# 0.6.0 - June 4, 2014
839
840### Major Library refactor:
841
842- Major internal overhaul to clean up the various dialect code.
843- Improved unit test suite.
844- Support for the [mariasql](https://github.com/mscdex/node-mariasql) driver.
845- More consistent use of raw query bindings throughout the library.
846- Queries are more composable, may be injected in various points throughout the builder.
847- Added [streaming](#Interfaces-Streams) interface
848- Deprecated 5 argument [join](#Builder-join) in favor of additional join methods.
849- The wrapValue function to allow for array column operations in PostgreSQL (#287).
850- An explicit connection can be passed for any query (#56).
851- Drop column support for sqlite3
852- All schema actions are run sequentially on the same connection if chained.
853- Schema actions can now be wrapped in a transaction
854- `.references(tableName.columnName)` as shorthand for `.references(columnName).inTable(tableName)`
855- `.join('table.column', 'otherTable.column')` as shorthand for .join('table.column', '=', 'otherTable.column')
856- Streams are supported for selects, passing through to the streaming capabilities of node-mysql and node-postgres
857- For More information, see this [pull-request](https://github.com/tgriesser/knex/pull/252)
858
859# 0.5.15 - June 4, 2014
860
861- Dropped indexes feature now functions correctly, (#278)
862
863# 0.5.14 - May 6, 2014
864
865- Remove the charset encoding if it's utf8 for mysql, as it's the default but also currently causes some issues in recent versions of node-mysql
866
867# 0.5.13 - April 2, 2014
868
869- Fix regression in array bindings for postgresql (#228)
870
871# 0.5.12 - Mar 31, 2014
872
873- Add more operators for where clauses, including && (#226)
874
875# 0.5.11 - Mar 25, 2014
876
877- `.where(col, 'is', null)` or `.where(col, 'is not', null)` are not supported (#221).
878- Case insensitive `where` operators now allowed (#212).
879- Fix bug in increment/decrement truncating to an integer (#210).
880- Disconnected connections are now properly handled & removed from the pool (#206).
881- Internal tweaks to binding concatenations for performance (#207)
882
883# 0.5.10 - Mar 19, 2014
884
885- Add the .exec method to the internal promise shim
886
887# 0.5.9 - Mar 18, 2014
888
889- Remove error'ed connections from the connection pool (#206), added support for node-postgres-pure (pg.js) (#200)
890
891# 0.5.8 - Feb 27, 2014
892
893- Fix for chaining on forUpdate / forShare, adding map & reduce from bluebird
894
895# 0.5.7 - Feb 18, 2014
896
897- Fix for a null limit / offset breaking query chain (#182)
898
899# 0.5.6 - Feb 5, 2014
900
901- Bump bluebird dependency to ~1.0.0, fixing regression in Bluebird 1.0.2 (#176)
902
903# 0.5.5 - Jan 28, 2014
904
905- Fix for the exit code on the migrations cli (#151).
906- The `init` method in `knex.migrate` now uses `this.config` if one isn't passed in (#156)
907
908# 0.5.4 - Jan 7, 2014
909
910- Fix for using raw statements in defaultTo schema builder methods (#146)
911
912# 0.5.3 - Jan 2, 2014
913
914- Fix for incorrectly formed sql when aggregates are used with columns (#144)
915
916# 0.5.2 - Dec 18, 2013
917
918- Adding passthrough "catch", "finally" to bluebird implementations, use bluebird's "nodeify" internally for exec
919
920# 0.5.1 - Dec 12, 2013
921
922- The [returning](#Builder-returning) in PostgreSQL may now accept \* or an array of columns to return. If either of these are passed, the response will be an array of objects rather than an array of values. Updates may also now use a `returning` value. (#132)
923- Added `bigint` and `bigserial` type to PostgreSQL. (#111)
924- Fix for the [specificType](#Schema-specificType) schema call (#118)
925- Several fixes for migrations, including migration file path fixes, passing a Promise constructor to the migration `up` and `down` methods, allowing the "knex" module to be used globally, file ordering on migrations, and other small improvements. (#112-115, #125, #135)
926
927# 0.5.0 - Nov 25, 2013
928
929- Initial pass at a [migration](#Migrations) api.
930- Aggregate methods are no longer aliased as "aggregate", but may now be aliased and have more than one aggregate in a query (#108, #110).
931- Adding bigint and bigserial to PostgreSQL (#111).
932- Bugfix on increment/decrement values (#100).
933- Bugfix with having method (#107).
934- Switched from when.js to [bluebird](https://github.com/petkaantonov/bluebird) for promise implementation, with shim for backward compatibility.
935- Switched from underscore to lodash, for semver reliability
936
937# 0.4.13 - Oct 31, 2013
938
939- Fix for aggregate methods on toString and clone, (#98)
940
941# 0.4.12 - Oct 29, 2013
942
943- Fix incorrect values passed to float in MySQL and decimal in PostgreSQL
944
945# 0.4.11 - Oct 15, 2013
946
947- Fix potential sql injection vulnerability in orderBy, thanks to @sebgie
948
949# 0.4.10 - Oct 14, 2013
950
951- Added [forUpdate](#Builder-forUpdate) and [forShare](#Builder-forShare) for select modes in transactions. (#84)
952- Fix bug where current query chain type is not copied on [clone](#Builder-clone). (#90)
953- Charset and collate are now added as methods on the schema builder. (#89)
954- Added `into` as an alias of [from](#Builder-from), for builder syntax of: `insert(value).into(tableName)`
955- Internal pool fixes. (#90)
956
957# 0.4.9 - Oct 7, 2013
958
959- Fix for documentation of [hasColumn](#Schema-hasColumn), ensure that `hasColumn` works with MySQL (#87).
960- More cleanup of error messages, showing the original error message concatenated with the sql and bindings
961
962# 0.4.8 - Oct 2, 2013
963
964- Connections are no longer pushed back into the pool if they never existed to begin with (#85)
965
966# 0.4.7 - Sep 27, 2013
967
968- The column is now a documented method on the builder api, and takes either an individual column or an array of columns to select
969
970# 0.4.6 - Sep 25, 2013
971
972- Standardizing handling of errors for easier debugging, as noted in (#39)
973
974# 0.4.5 - Sep 24, 2013
975
976- Fix for hasTable always returning true in MySQL (#82), fix where sql queries were duplicated with multiple calls on toSql with the schema builder
977
978# 0.4.4 - Sep 22, 2013
979
980- Fix for debug method not properly debugging individual queries
981
982# 0.4.3 - Sep 18, 2013
983
984- Fix for underscore not being defined in various grammar files
985
986# 0.4.2 - Sep 17, 2013
987
988- Fix for an error being thrown when an initialized ClientBase instance was passed into Knex.initialize. pool.destroy now optionally accepts a callback to notify when it has completed draining and destroying all connections
989
990# 0.4.1 - Sep 16, 2013
991
992- Cleanup from the 0.4.0 release, fix a potential exploit in "where" clauses pointed out by Andri Möll, fix for clients not being properly released from the pool #70, fix for where("foo", "<>", null) doing an "IS NULL" statement
993
994# 0.4.0 - Sep 13, 2013
995
996### Breaking Changes:
997
998- Global state is no longer stored in the library, an instance is returned from `Knex.initialize`, so you will need to call this once and then reference this `knex` client elsewhere in your application.
999- Lowercasing of `knex.raw`, `knex.transaction`, and `knex.schema`.
1000- Created columns are now nullable by default, unless `notNullable` is chained as an option.
1001- Keys created with `increments` are now assumed to be unsigned (MySQL) by default.
1002- The `destroyAllNow` is no longer called by the library on `process.exit` event. If you need to call it explicitly yourself, you may use `knex.client.destroyPool`
1003
1004# 0.2.6 - Aug 29, 2013
1005
1006- Reject the transaction promise if the transaction "commit" fails, (#50)
1007
1008# 0.2.5 - Aug 25, 2013
1009
1010- Fix error if a callback isn't specified for exec, (#49)
1011
1012# 0.2.4 - Aug 22, 2013
1013
1014- Fix SQLite3 delete not returning affected row count, (#45)
1015
1016# 0.2.3 - Aug 22, 2013
1017
1018- Fix insert with default values in PostgreSQL and SQLite3, (#44)
1019
1020# 0.2.2 - Aug 20, 2013
1021
1022- Allowing Raw queries to be passed as the primary table names
1023
1024# 0.2.1 - Aug 13, 2013
1025
1026- Fix for an array passed to insert being mutated
1027
1028# 0.2.0 - Aug 7, 2013
1029
1030### Breaking changes:
1031
1032- [hasTable](#Schema-hasTable) now returns a boolean rather than a failed promise.
1033- Changed syntax for insert in postgresql, where the `id` is not assumed on inserts (#18). The second parameter of [insert](#Builder-insert) is now required to return an array of insert id's for the last insert.
1034- The [timestamp](#Schema-timestamp) method on the schema builder now uses a `dateTime` rather than a `timestamp`
1035
1036# 0.1.8 - July 7, 2013
1037
1038- Somehow missing the != operator. Using _.find rather than _.where in getCommandsByName(#22)
1039
1040# 0.1.7 - June 12, 2013
1041
1042- Ensures unhandled errors in the exec callback interface are re-thrown
1043
1044# 0.1.6 - June 9, 2013
1045
1046- Renaming beforeCreate to afterCreate. Better handling of errors in the connection pooling
1047
1048# 0.1.5 - June 9, 2013
1049
1050- Added the ability to specify beforeCreate and beforeDestroy hooks on the initialize's options.pool to perform any necessary database setup/teardown on connections before use (#14). where and having may now accept Knex.Raw instances, for consistency (#15). Added an orHaving method to the builder. The ability to specify bindings on Raw queries has been removed
1051
1052# 0.1.4 - May 22, 2013
1053
1054- defaultTo now accepts "false" for boolean columns, allows for empty strings as default values
1055
1056# 0.1.3 - May 18, 2013
1057
1058- Enabling table aliases (#11). Fix for issues with transactions not functioning (#12)
1059
1060# 0.1.2 - May 15, 2013
1061
1062- Bug fixes for groupBy (#7). Mysql using collation, charset config settings in createTable. Added engine on schemaBuilder specifier (#6). Other doc fixes, tests
1063
1064# 0.1.1 - May 14, 2013
1065
1066- Bug fixes for sub-queries, minor changes to initializing "main" instance, adding "pg" as a valid parameter for the client name in the connection settings
1067
1068# 0.1.0 - May 13, 2013
1069
1070- Initial Knex release