39 Commits

Author SHA1 Message Date
Igor Savin
2b1e37ca44
Fix more tests for CockroachDB (#4729) 2021-10-13 01:19:56 +03:00
Igor Savin
d45a8c8607
Implement basic query cancellation for CockroachDB (#4723) 2021-10-10 20:15:47 +03:00
Igor Savin
33e8b9fcb9
Fix joins tests for CockroachDB (#4721) 2021-10-10 17:16:47 +03:00
Igor Savin
07c30bfcb8
Implement truncate method for CockroachDB, refactor and fix some tests (#4714) 2021-10-10 01:33:20 +03:00
Igor Savin
941b660f53
Initial infrastructure for CockroachDB (#4571) 2021-10-02 23:45:17 +03:00
Matt Machuga
0ab482bcfb
Unify db test helpers (#4356) 2021-03-08 14:16:07 +02:00
Igor Savin
2aec21ed5e
Try to introduce some organization into how files are grouped (#4178) 2020-12-28 16:55:08 +02:00
Igor Savin
b4f5080097
Add GitHub Actions (#4168) 2020-12-22 10:28:58 +02:00
Kkmatt11
629909475c
Fix MSSQL with returns on inserts and deletes on tables with triggers (#4152) 2020-12-18 01:12:04 +02:00
Rijk van Zanten
b7e1ffd7d5
Add support for dropForeign in SQLite (#4092)
Co-authored-by: Igor Savin <iselwin@gmail.com>
2020-12-08 14:49:41 +02:00
hansnull
8029396d2d
Mssql decimal fix (#3910) 2020-09-30 10:05:16 +03:00
Igor Savin
38f54ce8f0
Refactor migration logic to use async/await. Add test case for using classes with custom migration sources (#3838) 2020-05-05 19:10:50 +02:00
Igor Savin
e37aeaa31c
Prepare for 0.21.0 release (#3811) 2020-04-19 00:40:23 +02:00
Brian Lauber
9d07bc97ea
Removed some globals from tests (#3712)
* `chai` is no longer global

* sinon is no longer globally defined

* expect(..) is no longer defined globally

* Removed obsolete eslint hints about globals

* Removed unused variable ( `expect(..)` )
2020-03-08 19:48:23 -04:00
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
Igor Savin
e971c5198b
Update dependencies, fix new eslint errors (#3339) 2019-07-10 20:47:56 +02: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
Henry Williams
2611e5a300 Fix linter errors in tests (#2859)
* fix lint errors for tests
2018-10-15 22:29:53 -04: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
232fe9f151
Add Prettier (#2697)
* Add prettier
* Run files through prettier
2018-07-09 08:10:34 -04:00
Mikael Lepistö
cb3a85e738
Normalized and validated driverNames of test db clients and fixed oracle test setup (#2692)
* Normalized and validated driverNames of test db clients and fixed oracle test setup

* Fixed failed queries from old query building tests which hadn't been ran in ages

* Allow selecting node version which is used to run oracledb docker tests

* Improved sql tester error messages

* Fixed rest of the oracledb tests

* Removed invalid flag from docker-compose

* Print mssql logs if initialization fails

* Fixed syntax error + final tests

* Added restart of failure for mssql DB initialization to try again if server was not ready

* Printout always mssql logs after container is started

* Fixed wait time printing after trying to connect

* Use npm run oracledb:test for testing oracle in travis
2018-07-08 14:10:51 +03:00
Pablo M
a41316bb34 Fix knex.initialize() and adds test (#2477)
* Fix knex.initialize() and adds test

* Fix knex.initialize() and adds test

* Added test for reinitializing pool after destroy

* Fixed destroy / reinitialization test

* Fixed the fix
2018-07-02 23:52:32 +03:00
Igor Savin
843a16799d Support DB schema for migrations - fixes #2499 (#2559)
* WIP

* implement schema support for migrations

* Refactor

* Cleanup

* Restore unneeded changes

* Restore more removed code

* Restore newline

* Execute all tests

* Fix linting error

* Add schema creation

* Drop tables before dropping schema

* Cascade drop for schema
2018-04-05 01:19:08 +03:00
Sami Koskimäki
8771bd4781 Use tarn as pool (#2450)
* replace generic-pool with Tarn

* fix bug where mariadb client didn't propagate connection errors to pool

* destroy connection if a query times out (and cancellation is not enabled)

Before this change, when a query timeout happened without { cancel: true }
the connection was immediately released back to the pool. If the query
timed out because of a time consuming query, the released connection would
still execute the query to its end and the connection would be useless until
that time. This commit marks the connection as disposed so that the pool never
again gives that connection to anyone, and destorys it in the near future.

* fix a weird database version dependent casing bug in a tests

* fix an unstable test that failed randomly because the query order was not guaranteed
2018-02-07 11:17:17 +02:00
Jonathan Stewmon
9122cbf6df upgrade generic-pool to 3.1.7 (#2208)
* Upgrade generic-pool to v3.1.7 (Attempt)

* Remove callback from pool create function

* Fix ESLint

* Send whole poolConfig to generic-pool (for idleTimeoutMillis etc)

* fix compatibility issues with generic-pool v3
- restore Client.poolDefaults to allow dialect overrides
- connection validators should always resolve with a boolean
- rely on generic pool acquire timeouts to avoid unhandled rejections
- simplify promise usage, avoiding Promise constructor anti-pattern
- enable testOnBorrow in docker tests to evict broken connections
- enable docker tests on Darwin
- enable docker tests for mysql2 dialect

* validate timeout settings and to 60s

* simplify Client.destroy promise handling

* return destroyRawConnection promise from dialects
2017-09-06 22:51:29 +03:00
Tim Griesser
7069ce509e Revert to generic pool (#1665) 2016-09-13 18:12:23 -04:00
Cyprien Autexier
0e693dfdca replace bigint unit test by integration tests 2016-05-29 18:16:32 +02:00
Tim Griesser
36ced91ed5 Testing transactions, beginning to use tape, adding query to error message 2015-04-24 10:10:34 -04:00
Tim Griesser
f9aab9dc76 Major internal refactor
Beefed up transaction implementation, still needs tests
and cleanup of nested transaction queues.

Left todo:
- Fix commented out tests
- Fix oracle driver's transactions
2015-04-22 10:34:14 -04:00
Tim Griesser
27cd9f12c5 Cleanup pool implementation, preparing things for new release 2015-04-17 15:00:08 -04:00
Vincent Schoettke
98f4f9a1dd Removed jshint expr and fixed warnings 2014-09-02 22:03:14 +02:00
Vincent Schoettke
f3874ac651 Fixed several jshint warnings. Added strict mode 2014-09-01 17:19:34 +02:00
Noah Santorello
690326ea33 Adding integration tests for seeds 2014-07-21 18:38:40 -04:00
Tim Griesser
7332b86688 Remove extraneous console.log 2014-06-13 13:14:00 -04:00
Tim Griesser
a24dedb567 Remove weird git whitespace 2014-06-12 14:07:33 -04:00
Tim Griesser
7722011721 Tests for #314 2014-06-12 14:00:44 -04:00
Johannes Lumpe
838b53a2d8 Made migration tests pass 2014-04-27 12:00:51 +03:00
Tim Griesser
0de9513a78 all tests green 2014-04-16 01:23:50 -04:00
Tim Griesser
4c589cc960 working on refactoring the internals 2014-02-14 12:46:13 -05:00