373 Commits

Author SHA1 Message Date
Lorefnon
452cbe8f35 Add support to transform raw SQL through user specified transformers 2020-02-23 11:17:36 +05:30
Jake Coffman
22558209d4 dispose Oracle connection on connection error (#3611)
Co-authored-by: abskmj <abskmj@gmail.com>
2020-01-05 18:47:32 +01:00
Kabir Baidhya
2800e72d2f Add tests for some of the string utility functions (#3568) 2020-01-04 22:59:41 +01:00
Jake Coffman
07997279b7 fix #3605 not releasing connection from pool on disconnect (#3606) 2020-01-04 22:56:14 +01:00
Igor Savin
4feefdf3d2 Enforce Unix (lf) line terminators (#3598) 2019-12-29 20:28:40 +01:00
Igor Savin
9b37c9480b
Return more information about empty updates (#3597) 2019-12-28 22:36:14 +01:00
MaliaGuerrero
03d6f063d5 Initialize data to buffer instead of string for non-strings (#3545) 2019-11-21 19:46:45 +01:00
Lorefnon
79ccb7d8bd Lift up dialect specific methods in the CreateTableBuilder (#3532) 2019-11-21 15:22:29 +01:00
Edvard Chen
0560959fa4 feat: wrap subQuery with parenthesis when it appears as table name (#3496) 2019-10-28 21:38:01 +01:00
EthanHur
2d0459111d orderBy accepts QueryBuilder (#3491) 2019-10-24 16:08:12 +02:00
EthanHur
c53227564d add validation in .offset() (#2908) 2019-10-15 13:24:49 +02:00
maximelkin
c9e305760d Fix oracledb driver v4 support (#3480) 2019-10-15 08:23:07 +02:00
Igor Savin
e112a21597 Remove unneeded logging 2019-10-06 23:23:38 +02:00
Igor Savin
988fb24389
Fix MSSQL escaping (#3382) 2019-10-06 20:21:32 +02:00
Roland Németh
c1d20270d6 Fix handling of multiline SQL in SQLite3 schema (#3411) 2019-10-06 18:27:52 +02:00
Kristjan
4ade98980e feat: add undefined columns to undefined binding(s) error (#3425) 2019-09-04 22:59:04 +02:00
Taras Ozarko
d6426d75e1 Add ability to manually define schema for enu with useNative (#3307) (#3413) 2019-08-25 23:07:30 +02:00
Ihor Sakaylyuk
1ef1a4ef07 Fix native enum with specified schema (#3307) (#3400) 2019-08-24 17:37:29 +02:00
Igor Savin
871dadb348
More consistent handling of nested transactions (#3393) 2019-08-16 16:28:25 +02:00
Igor Savin
2c3b4ded7b
Fallback to JSON when using JSONB in MySQL (#3394)
fixes #3386
2019-08-14 17:11:01 +02:00
Felix Mosheev
8111bb3ee8 Feat: Allow to extend knex query builder (#3334) 2019-07-23 20:45:03 +02:00
Matthew Kuo
054ce36b0a Add .isCompleted() to transaction (#3368) 2019-07-23 17:59:55 +02:00
Igor Savin
fb06464da0
Update tarn.js (#3345)
* Update tarn.js
* Remove beforeDestroy
2019-07-11 14:57:59 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Igor Savin
e971c5198b
Update dependencies, fix new eslint errors (#3339) 2019-07-10 20:47:56 +02:00
Ricardo Maes
bc1ddcad01 Implement "skipLocked()" and "noWait()" (#2961) 2019-07-06 14:05:53 +02:00
Dmitrii Maganov
a0e9be548d Fix return duplicate transaction promise for standalone transactions (#3328) 2019-07-04 22:05:23 +02:00
Lorefnon
56c3af8512 Fix issues around specifying default values for columns (#3318) 2019-06-30 20:08:15 +02:00
Igor Savin
4a631a3c00
Do not reject promise on transaction rollback (#3235) 2019-06-21 12:56:00 +02:00
Igor Savin
f328fbbdb4
Expose executionPromise for transactors (#3297) 2019-06-19 22:12:21 +02:00
Igor Savin
1e950b93e4
Name Bluebird usage explicitly. Remove spread and thenReturn (#3285) 2019-06-17 02:14:17 +02:00
Igor Savin
4b6429ebf9
Reduce bluebird usage (#3267) 2019-06-08 02:34:41 +02:00
Igor Savin
c431ffc35a
Drop support for Node.js 6. Remove babel. (#3227) 2019-06-04 00:37:17 +02:00
Adrien Risser
9b74ccbfad Fix error message bubbling up on seed error (#3248) 2019-06-03 18:10:23 +02:00
Igor Savin
f599f6ac13
Try using much smaller timeouts (#3226) 2019-05-27 23:21:21 +02:00
Igor Savin
5307dacc66
Implement support for returning started transaction without using transaction() methods callback function (#3099) 2019-05-26 18:03:07 -07:00
Lorefnon
54a7a4a35f Support multi-column whereIn in sqlite through values clause (#3220)
Fixes #3042
2019-05-25 12:53:20 -07:00
Lorefnon
e2e044c0f2 Unify object options handling for datetime/timestamp across dialects and update type definitions (#3181)
* Fix windows incompatiblity in npm scripts

* Update timestamp and datetime signature in oracle dialect to be consistent with other dialects
2019-05-19 05:10:59 -07:00
Mikael Lepistö
8a9a648ae2
Docker based test dbs (#3157)
* Fixed some of the tests failing with various dialect combinations

* Setup all test databases to run in docker

* Fixed test suite and updated travis to use docker

* Fixed some tests in master and disabled oracle tests while setting everything else to work again

* Changed docker to use latest postgresql alpine image

* Re-enabled all oracledb tests

* Install oracle client libs to oracle server and copy them to travis to make node oracledb package to work

* Disabled random failing oracle tests and added test to show that oracle update in transaction does not seem to work ACID

* Update package.json

* Update package.json

* Fixed linting issues

* Fixed waiting for postgres to use the same DB image that database is using.

* Removed installing oracledb driver in travis if not needed .travis.yml

* Cleaned up package.json more

* Created static name for oracledb container to allow copying files out of it on different docker versions

* Removed webpack from deps
2019-05-13 12:21:36 +03:00
Daniel Mills
617d36ea01 add clearHaving function and add test (#3141) 2019-05-12 10:20:26 +02:00
Andrew Schmadel
b15ee3def1 make unionAll()'s call signature match union() (#3055)
* make unionAll()'s call signature match union()

consolidates the logic used by union() and unionAll(), allowing the two to be used interchangeably

* use spread args instead of arguments array

* Fix unionAll spread arguments
2019-03-29 19:55:32 +02:00
Igor Savin
e7ed005995
Fix queryContext not being passed to raw queries (#3111)
* Fix queryContext not being passed to raw queries

* Add unit case for transaction as well
2019-03-19 00:45:08 +01:00
elunic
19926d8eba [#3033] fix: sqlite3 drop/renameColumn() breaks with postProcessResponse (#3040)
* [#3033] fix: sqlite3 drop/renameColumn() breaks with postProcessResponse

* When postProcessResponse is configured, and client.processResponse()
returns a Promise (e.g. for custom cases such as sqlite3 dropColumn()),
then that Promise is not awaited, but handed to postProcessResponse,
which might break is (e.g. with Objection's knexSnakeCaseMappers()).

* when reinserting data in the modified table, the rows are now being
handled with the "mapped" identifiers (instead of the unmapped)

* add tests, fix hasColumn

* add hasColumn tests for add mysql + snakeCaseMappers

* Improve tests and fix more cases related to processing

* Fix SQLite-specific tests

* MySQL is not case-sensitive, pg is
2019-03-13 22:58:59 +01:00
Igor Savin
24fcf27e05
Fix transaction support for migrations (#3084)
* Fix transaction support for migrations

* Clarify warning

* Clarify warning message

* Simplify logic, make enabling/disabling more consistent

* Fix tests

* Fix test

* Reduce duplication
2019-03-13 22:47:43 +01:00
Pierre Voisin
0aacab50be Fix for #2998 - Migrator & TypeScript (#3041)
* Fix `#listAllAndCompleted` not considering `loadExtensions` in migrator configuration (#2998)

* Add unit test

* Fix linting
2019-03-09 23:39:55 +01:00
EthanHur
0db785949b add test that clearing offset (#2954)
* add test that clearing offset

* fix typo
2019-03-05 16:25:30 +01:00
Igor Savin
b269e45842
Update dependencies (#3085)
* Update dependencies

* Fix linting errors
2019-03-04 01:40:35 +01:00
thekuom
71e097b663 add intersect() (#3023)
* add intersect()

* update intersect integration tests to validate results

* use const instead of var, remove .only in test, remove commented out type
2019-03-03 20:57:40 +01:00
EthanHur
dfe01298d2 mysql warn .returning() does not have any effect. (#3039)
* mysql warn `.returning()` does not have any effect.

* add test if warning is emitted or not
2019-03-03 14:53:06 +02:00
Igor Savin
26868f864c Fix event listener duplication (#2982)
* Fix event listener duplication. Start executing more tests in CI; fix broken test.

* Fix listener

* Fix listener

* Fix Node 6 support

* There doesn't seem to be a clear way to fix listener behaviour in Node 6, so let's just ignore it for the time being, especially considering that we are dropping support for Node 6 in April anyway.

* Update migration guide
2019-01-31 07:23:05 +02:00