25 Commits

Author SHA1 Message Date
Igor Savin
871dadb348
More consistent handling of nested transactions (#3393) 2019-08-16 16:28:25 +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
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
Dmitrii Maganov
a0e9be548d Fix return duplicate transaction promise for standalone transactions (#3328) 2019-07-04 22:05:23 +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
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
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
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
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
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
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
Igor Savin
ff75f1d2bd
Do not reset prior Promise overrides on knex import (#2944)
* Do not reset prior Promise overrides on knex import

* Do not leak global state outside of the test
2018-12-10 18:20:06 +02:00
Igor Savin
1eac063b28
Do not postprocess internal queries in Migrator (#2914)
* Do not postprocess internal queries in Migrator

* Fixes

* Fix var -> const autofix

* Fix regression
2018-11-19 12:55:50 +01:00
Henry Williams
2611e5a300 Fix linter errors in tests (#2859)
* fix lint errors for tests
2018-10-15 22:29:53 -04:00
Dale Anderson
46dbe917d7 Throw instead of process.exit when client module missing (#2843)
* Change process.exit to throw

* Add error message to wrapped error
2018-10-08 07:04:28 +02:00
Igor Savin
8c87650388 Support passing connection override to a query (#2817)
* Support passing connection override to a query

* Include connection param when cloning

* Only clone connection override if specified
2018-09-27 01:08:18 +03:00
Igor Savin
d4a3387c56 Pass migration config object as an argument to the migrations (V 2.0) (#2802)
* Pass migration config object as an argument to the migrations themselves, to allow custom parameters to be set for migrations. (#2014)

* Run prettier

* Remove unneeded change

* Remove more unneeded changes

* Fix Node 10 support

* Update documentation based on a new design

* Restore test execution (oops)

* Fix withUserParams method

* Fix knex instance cloning

* Remove unused import

* Fix reference to knex from migrator

* Do not lose user params on transactions

* Remove unneeded require

* Address review comments

* Fix setting event emitter and listeners on Knex copies. Use knex copies to run tests in CI

* Remove knex cloning

* Fix event listener leak
2018-09-26 23:27:59 +03:00
Igor Savin
89d2b3a5e1 #2758: Implement fail-fast logic for dialect resolution (#2776)
* Implement fail-fast logic for dialect resolution, clean-up code around.

* Remove method that was deprecated long time ago

* Address additional comments

* Try addressing comments

* Set client explicitly

* Fix compatibility with older Node versions
2018-08-29 18:13:16 +03:00
Tim Griesser
4c589cc960 working on refactoring the internals 2014-02-14 12:46:13 -05:00
Tim Griesser
faa2497ef1 wip unit tests & refactoring 2013-09-05 16:36:49 -04:00