103 Commits

Author SHA1 Message Date
Igor Savin
3c6a1fb852
Fix final tests failing on CockroachDB (#4741) 2021-10-15 18:02:55 +03:00
Igor Savin
d45a8c8607
Implement basic query cancellation for CockroachDB (#4723) 2021-10-10 20:15: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
Pete Nykänen
49b05b5c71
Add support for mysql/mariadb-client JSON parameters in connectionURIs (#4629)
Signed-off-by: petetnt <pete.a.nykanen@gmail.com>
2021-08-30 20:19:08 +03:00
Wigger Boelens
267ff3a28b
Add support for file open flags for sqlite3 (#4446) 2021-04-22 00:50:03 +03:00
Matt Machuga
0ab482bcfb
Unify db test helpers (#4356) 2021-03-08 14:16:07 +02:00
Igor Savin
230845d3c2
Make "first" and "pluck" mutually exclusive (#4280) 2021-02-08 13:45:13 +02:00
Igor Savin
b111771117
Clean up querybuilder (#4220) 2021-01-09 17:59:53 +02:00
Lorefnon
e107ceacfc
Make toSQL().toNative() work for Raw to match the API for QueryBuilder (#4058)
Co-authored-by: Igor Savin <iselwin@gmail.com>
2021-01-02 16:26:29 +02:00
Igor Savin
2aec21ed5e
Try to introduce some organization into how files are grouped (#4178) 2020-12-28 16:55:08 +02:00
maximelkin
4da221ba4f
whatwg url connection string parsing (#3702) 2020-12-28 00:09:58 +02:00
Igor Savin
40621fac9e
Update dependencies (#3830) 2020-04-26 19:35:06 +02:00
Igor Savin
e37aeaa31c
Prepare for 0.21.0 release (#3811) 2020-04-19 00:40:23 +02:00
Igor Savin
7568ab51c4
Split tests in groups (#3785) 2020-04-07 21:27: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
maximelkin
88d832cd36
replace Bluebird.timeout (#3634) 2020-02-12 21:42:15 +01:00
Andrei
07276bcbbb Add connection string qs to connection params (#3547) 2019-11-21 15:21:51 +01:00
maximelkin
4a71315e9c remove bluebird.each (#3471) 2019-10-12 21:39:34 +02:00
Harminder Virk
831b9bcc43 fix: make transaction rejection consistent across dialects (#3399) 2019-08-17 13:01:03 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Igor Savin
5301b29186
Prepare for 0.18.0-next1 release (#3291) 2019-06-18 01:36:28 +02:00
Igor Savin
1e950b93e4
Name Bluebird usage explicitly. Remove spread and thenReturn (#3285) 2019-06-17 02:14:17 +02:00
Igor Savin
c431ffc35a
Drop support for Node.js 6. Remove babel. (#3227) 2019-06-04 00:37:17 +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
Igor Savin
9daf7f3d09
Display name of a failed seed (#2973) 2018-12-27 18:20:13 +01:00
Henry Williams
2611e5a300 Fix linter errors in tests (#2859)
* fix lint errors for tests
2018-10-15 22:29:53 -04:00
Jake Ginnivan
bf1e384ed6 Introduced abstraction for getting migrations (#2775)
* Introduced abstraction for getting migrations

This would allow a webpack migration source which is compatible with bundling.

* Fixed migration validation with custom migration source

* Fixed issues after rebasing on muti directory PR

* Renamed parameter and fixed error message

* Addressed some PR comments

* Finished comment

* Moved filename extension filtering into fs-migrator

* Added test showing in memory custom migration source

* Cleaned up how to get config

* Fixed failing test

* Hopefully fix tests

* Fix Node.js 10 support in tests
2018-09-12 14:58:37 +03:00
Igor Savin
91f23bc02f Feature/2690: Multiple migration directories (#2735)
* Implement support for multiple migration directories

* Add tests for new functionality

* Fix tape tests

* Pass migration directory upwards

* Fix multiple directory support

* Fix bugs

* Rollback correctly

* Fix remaining tests

* Address comments
2018-08-24 12:39:20 +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
Mikael Lepistö
e2f617b968
Drop mariadb support (#2681)
* Dropped support for mariasql

* ESLint
2018-07-01 23:06:26 +03:00
Mikael Lepistö
b349ac4a8c
Various fixes to mssql dialect (#2653)
* Fixed float type of mssql to be float

* Many tests where postgres test was not actually ran at all

* Migrations to be mssql compatible

Mssql driver doesn't handle if multiple queries are sent to same transaction concurrently.

* Prevented mssql failing when invalid schema builder was executed by accident

Instead of trying to generate sql from broken schema calls, just make exception to leak before query compiling is started

* Fixed mssql trx rollback to always throw an error

Also modified some connection test query to be mssql compatible

* Fixed various bugs from MSSQL driver to make tests run

* Fixed mssql unique index to be compatible with other dialect implementations

* Enable running mssql tests on CI

* Test for #2588

* Updated tests to not be dependend on tables left from previous test rans

* Trying to make mssql server work on travis
2018-06-29 10:47:06 +03:00
Igor Savin
d9cd54b2ac Remove readable-stream and safe-buffer (#2640)
* Add json support to the query builder for mysql

refs #1036

Based on #1902

* Clarify supported version

* Use native Buffer and Stream implementations
2018-06-01 14:34:27 +03:00
Andy Stanberry
51e44052b4 Support postgresql connection uri protocol (#2609) 2018-05-18 12:12:15 +03:00
Mikael Lepistö
c89119b681 Fixed running tape tests when DB variable not set 2018-04-08 22:27:33 +03:00
Mikael Lepistö
ece2da12ca
Added npm run test:oracledb command that runs oracledb tests in docker (#2491)
Also cleaned up some old docker configurations from test knexfile
2018-02-20 10:47:05 +02: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
Mikael Lepistö
c0ac1077b6
More pool tests and test on borrow default (#2341)
* Test pool eviction when DB closes connection

* Added couple of tests for how pool works and added testOnBorrow to defaults
2017-11-19 18:43:28 +02:00
Mikael Lepistö
e405d669a6
Fixed passing connection errors directly to the query (#2336)
* Fixed passing connection errors directly to the query

* Added missing use strict and fixed select to be oracle compatible.

* Fixed dialect name which is mixed in different configs

* Oracledb didnt have database config attribute
2017-11-17 21:03:43 +02:00
wubzz
a4bfee7751 Ensure that 'client' is provided in knex config object (#1822)
* Ensure that 'client' is provided in knex config object

* sqlite3 columncompiler: Assign 'modifiers' --after-- super() call.

* oracle columncompiler: Assign 'modifiers' --after-- super() call.
2016-12-11 18:23:44 +02:00
Tim Griesser
f2215c40d8 Updating/pruning some deps 2016-10-12 01:05:08 -04:00
Tim Griesser
3a3cad9f88 Fix #1694 2016-10-09 14:33:51 -04:00
Tim Griesser
7069ce509e Revert to generic pool (#1665) 2016-09-13 18:12:23 -04:00
Tim Griesser
48a2ee1648 Deprecate Knex.Promise 2016-09-13 08:19:47 -04:00
Tim Griesser
ee217ce2a1 Fix PG string escaping behavior (#1661)
* Modify test suite to test #1602
We shouldn’t be testing the “default” client class. Replace any
usages with postgresql

* Simplify knex.raw, deprecate global Knex.raw usage

* Remove unused bluebird shim

* Remove old / unused test comments

* Don't capture Pool2 error event

* Fix pg string escaping & parameterization #1602, #1548
2016-09-12 18:01:47 -04:00
David Overcash
6193701c8d Typo. 2016-06-17 11:04:35 -07:00
David Overcash
9ec6984cc3 Fix a test that wasn't able to compare with new __knexQueryUid field. 2016-06-17 10:57:03 -07:00
Rob Scott
6c7809caae Adding support for specifying a DATABASE_URL without a password 2016-06-06 22:19:24 -04:00