387 Commits

Author SHA1 Message Date
Jake Coffman
d50d00644c
oracledb: commit was a no-op causing race conditions (#3668)
The underlying issue was that query *always* committed, even during a transaction. The previous fix was to just disable commitAsync in a transaction but then that also disabled explicit commit calls. Instead, this fix disables query's commits during transactions so that explicit commits still work.
2020-02-16 20:26:13 +01:00
maximelkin
88d832cd36
replace Bluebird.timeout (#3634) 2020-02-12 21:42:15 +01:00
Igor Savin
80a2516734
Throw better error when trying to modify schema while using unsupported dialect (#3609) 2020-01-05 00:04:41 +01:00
Igor Savin
4feefdf3d2 Enforce Unix (lf) line terminators (#3598) 2019-12-29 20:28:40 +01:00
Ahmed Ashour
a613fe23df Fix some spelling mistakes (#3572) 2019-12-10 22:53:05 +01:00
Lorefnon
79ccb7d8bd Lift up dialect specific methods in the CreateTableBuilder (#3532) 2019-11-21 15:22:29 +01:00
Alexandre BODIN
0214f11663 Make sqlite3 hasColumn case insensitive (#3435) 2019-11-14 19:31:59 +01:00
Lorefnon
f87b28c3e3 Add support for distinct on for postgres (#3513)
Resolves #3472
2019-11-11 00:51:47 +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
Oran Epelbaum
f4b6848594 Dynamic connection configuration resolution (#3497) 2019-10-27 16:14:18 +01:00
Igor Savin
1c65562440 Prepare 0.20.0 release 2019-10-25 20:17:26 +02:00
Nekrasov Ilya
6b9fb0ec01 disable_migrations_list_validation_feature (#3448) 2019-10-12 21:45:39 +02:00
Lorefnon
20bd04b594 Fix bugs in replacement logic used when dropping columns in SQLite. (#3476) 2019-10-11 22:38:01 +02:00
maximelkin
f56eaf5cfc Bluebird remove map mapSeries (#3474) 2019-10-11 10:12:56 +02:00
EthanHur
f782348da7 replace Bluebird.map to Promise.all (#3469) 2019-10-09 14:39:45 +02:00
Roland Németh
c1d20270d6 Fix handling of multiline SQL in SQLite3 schema (#3411) 2019-10-06 18:27:52 +02:00
Igor Savin
53d8649ef3
Update test to accommodate for increased precision in PG 12 (#3465) 2019-10-06 18:23:00 +02:00
Tim Hibbard
68e1ae2aed Support stored procedures in Oracle 2019-09-22 22:31:56 +02:00
Martti Laine
5417cacdb1 Fix for concurrent child transactions failing (#2213) (#3440)
* Fix for concurrent child transactions failing (#2213)

* Skip new sibling transaction test for mssql

* Update test to ensure Promise resolve order
2019-09-20 14:37:58 +02:00
Ben Darnell
8f40f8d534 migrate: Refactor _lockMigrations to avoid forUpdate (#3395) 2019-08-28 13:27:18 +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
Ricardo Maes
18632edfc6 Fix broken noWait test (#3398) 2019-08-16 07:29:24 +02:00
Igor Savin
49456691d8
Update dependencies (#3366) 2019-07-23 18:00:13 +02:00
Lorefnon
3e1a5ee0de Minor enhancements around aliasing of aggregates (#3354)
- Allows an options object to specify alias (as suggested in https://github.com/tgriesser/knex/issues/3315#issuecomment-507439215) (Closes #3315)
- Allows multiple aliases when using object syntax (Closes #2871)
2019-07-16 18:48:28 +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
Felix Mosheev
8b31a43761 feat: Run specific seed file (closes #801) (#3335) 2019-07-07 11:11:39 +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
f392b5cef3
Remove Bluebird.method and one instance of .bind (#3290) 2019-06-18 00:07:24 +02:00
Benjamin Ki
9d8e900050 refactor: replace usage of Bluebird Promise.tap with native Promise.then (#3287) 2019-06-17 13:00:31 +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
Lee Allen
1fe5ee0ea3 Add migrate:down functionality (#3228) 2019-05-30 00:37:18 +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
Lee Allen
08478f2db9 Feature/add up for migrations (#3205)
* Add ability to run migrate:up command to only run the next migration

* Add cli test for migrate:up

* Add test for migrator

* Add stub

* Add type

* Fix wording of test
2019-05-19 04:14:52 -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
Lee Allen
a2ab754eed Bugfix/rollback all wrong order (#3172)
* Fix rollback all bug attempting to perform rollback in chronological order

* Set up second migration to depend on first migration so when rolling back order is tests

* Add test for rollback all only running completed tests in reverse chronological order
2019-05-01 00:21:49 +02:00
Igor Savin
fe6083eda4 Support nullable timestamps on MySQL (#3100)
* Add test to recreate the issue

* Improve test, add some documentation

* Improve test

* Add explicit nullable flag to column

* Set nullability explicitly on MySQL to deal with timestamp edge case

* Use same assertion for everything
2019-03-30 15:58:56 +02: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
1b39d67550
Tests for drop-and-recreate with async/await (#3083)
* Add test for drop-and-recreate with async/await

* Add some tests with schema

* Use correct migrations

* Add tests with promise chains for comparison

* Fix migration

* Fix Node 6 compatibility
2019-03-05 01:03:51 +01:00
Randy Garces
c2bf7a375c MSSQL removes support column width/length on data type int and tinyint (#2738)
* MSSQL remove support column width/length on data type int

- fixes error `Cannot specify a column width on data type int`
- ignore length even if pass as agrument

* Add integration test for numeric lengths

* Fix syntax

* Add test that actually executes SQL

* Fix failing tests

* Fix tests
2019-03-05 01:02:06 +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
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