38 Commits

Author SHA1 Message Date
Igor Savin
07c30bfcb8
Implement truncate method for CockroachDB, refactor and fix some tests (#4714) 2021-10-10 01:33:20 +03:00
Jeremy W. Sherman
3718d647e4
Respect KNEX_TEST, support omitting sqlite3 from DB, and reduce outside mssql test db config (#4313) 2021-02-24 19:27:30 +02:00
Tyler Watson
8c73417de6
events: introduce queryContext on query-error (#4301) 2021-02-18 12:23:12 +02:00
maximelkin
b9fb5992b5
Migrate to classes (#4253) 2021-01-31 12:40:13 +02:00
Igor Savin
b111771117
Clean up querybuilder (#4220) 2021-01-09 17:59:53 +02:00
Igor Savin
a9773b79a3
Extract static methods outside of a formatter (#4213) 2021-01-07 02:04:10 +02:00
Igor Savin
c16b731fdc
Change default behaviour for transaction rollback (#4195) 2021-01-02 14:23:40 +02:00
Igor Savin
3246c1f9fa
Add missing event propagation (#4087) 2020-10-29 12:02:03 +02:00
Bogdan Chadkin
80355e4850
Replace inherits package with builtin utility (#4059) 2020-10-05 23:59:12 +03:00
Igor Savin
e37aeaa31c
Prepare for 0.21.0 release (#3811) 2020-04-19 00:40:23 +02:00
Brian Lauber
8d5715a03a
Fix: Support for .finally(..) on knex's Promise-alikes (#3800) 2020-04-15 21:05:40 +02:00
Brian Lauber
05fedd9e11
Mark missing test cases as "pending" rather than "passed" (#3695)
* Missing test cases are marked as "pending" rather than "passed"
* Work-around for connection disposal bug in pooling logic...

See this conversation thread for more info: https://github.com/knex/knex/issues/3636#issuecomment-592005391
2020-03-02 01:04:01 +01:00
maximelkin
8159f04c12
Remove dependency on bluebird methods from tests (#3682)
* Remove dependency on bluebird methods from tests
* Introduce `"chai-as-promised"` plugin
* Minor enhancements to the testing logic
2020-02-24 19:24:30 -05:00
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