56 Commits

Author SHA1 Message Date
Igor Savin
941b660f53
Initial infrastructure for CockroachDB (#4571) 2021-10-02 23:45:17 +03:00
Matt Machuga
01cfa98c2c
Adding support for pg-native (#4327) 2021-09-06 16:04:23 +03:00
Igor Savin
938d5c263a Add more debug output for dialect resolution 2020-12-25 20:33:06 +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
Igor Savin
e37aeaa31c
Prepare for 0.21.0 release (#3811) 2020-04-19 00:40:23 +02:00
maximelkin
531714804b Use util.promisify instead of Bluebird.promisify (#3470) 2019-10-15 09:11:59 +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
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
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
Mikael Lepistö
e2f617b968
Drop mariadb support (#2681)
* Dropped support for mariasql

* ESLint
2018-07-01 23:06:26 +03:00
Simon Lidén
05e9150346 Drop support for strong-oracle (#2487) 2018-05-29 13:31:40 -04:00
Adam Cofer
ee8cc35ecb Fix #2545, bring redshift wrapIdentifier custom hook up to date with postgres (#2551)
* Add a Redshift dialect that inherits from Postgres.

* Turn .index() and .dropIndex() into no-ops with warnings in the Redshift dialect.

* Update the Redshift dialect to be compatible with master.

* Update package.json

* Disable liftoff cli

* Remove the CLI

* Add lib to the repo

* Allow the escaping of named bindings.

* Update dist

* Update the Redshift dialect’s instantiation of the query and column compilers.

* Update the distribution

* Fix a merge conflict

* Take lib back out

* Trying to bring back in line with tgreisser/knex

* Add npm 5 package-lock

* Bring cli.js back in line

* Bring cli.js back in line

* Progress commit on redshift integration tests

* Revert "Progress commit on redshift integration tests"

This reverts commit 207e31635c638853dec54ce0580d34559ba5a54c.

* Progress commit

* Working not null on primary columns in createTable

* Working redshift unit tests

* Working unit and integration tests, still need to fix migration tests

* Brought datatypes more in line with what redshift actually supports

* Added query compiler unit tests

* Add a hacky returning clause for redshift ugh

* Working migration integration tests

* Working insert integration tests

* Allow multiple insert returning values

* Working select integration tests

* Working join integration tests

* Working aggregate integration tests

* All integration suite tests working

* Put docker index for reconnect tests back

* Redshift does not support insert...returning, there does not seem to be a way around that, therefore accept it and test accordingly

* Leave redshift integration tests in place, but do not run them by default

* Fix mysql order by test

* Fix more tests

* Change test db name to knex_test for consistency

* Address PR comments

* Sublime Text gitignore

* Redshift does not support adding more than one column in alter table

* Fix integration tests for redshift

* Linter

* Combine dialect test skip if clause
2018-04-05 01:43:39 +03:00
Mikael Lepistö
ce0946e74b
Runnin mssql tests in docker (#2496)
* Run SQL Server tests locally running SQL server in docker

* Made oracledb test script naming consistent with mssql

* Updated documentation with more info about oracledb and mssql testing
2018-02-20 11:51:51 +02: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
Adam Cofer
5f81e8aeb9 Add redshift support without changing cli or package.json (#2233)
* Add a Redshift dialect that inherits from Postgres.

* Turn .index() and .dropIndex() into no-ops with warnings in the Redshift dialect.

* Update the Redshift dialect to be compatible with master.

* Update package.json

* Disable liftoff cli

* Remove the CLI

* Add lib to the repo

* Allow the escaping of named bindings.

* Update dist

* Update the Redshift dialect’s instantiation of the query and column compilers.

* Update the distribution

* Fix a merge conflict

* Take lib back out

* Trying to bring back in line with tgreisser/knex

* Add npm 5 package-lock

* Bring cli.js back in line

* Bring cli.js back in line

* Progress commit on redshift integration tests

* Revert "Progress commit on redshift integration tests"

This reverts commit 207e31635c638853dec54ce0580d34559ba5a54c.

* Progress commit

* Working not null on primary columns in createTable

* Working redshift unit tests

* Working unit and integration tests, still need to fix migration tests

* Brought datatypes more in line with what redshift actually supports

* Added query compiler unit tests

* Add a hacky returning clause for redshift ugh

* Working migration integration tests

* Working insert integration tests

* Allow multiple insert returning values

* Working select integration tests

* Working join integration tests

* Working aggregate integration tests

* All integration suite tests working

* Put docker index for reconnect tests back

* Redshift does not support insert...returning, there does not seem to be a way around that, therefore accept it and test accordingly

* Leave redshift integration tests in place, but do not run them by default

* Fix mysql order by test

* Fix more tests

* Change test db name to knex_test for consistency

* Address PR comments
2018-02-03 15:33:02 +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
Mikael Lepistö
c7dfcb6292 Fixing docker CI tests (#2164)
* Fixing docker CI tests

* Removed support for node 0.12 and added node 8 to CI

* Trying to fix babel issue happening on node 8

* Could not reproduce the problem on local install... disabling node 8 travis tests for now.
2017-07-23 16:33:25 +03:00
smulesoft
31ba04a788 fixes #1833 on postgres (#2017)
* fixes #1833 on postgres

* adds @elhigu requested changes

* adds test when database is down

* adds script for docker support

* removes old comment

* fixes syntax

* fixes more syntax errors

* fixes final syntax errors

* Docker testing enabled only on linux for now
2017-06-01 22:41:35 +03:00
Alexandre Tiertant
3609de76b3 fix oracle tests (#1741)
* Fix Oracle dialect to pass integration tests$

* Update transaction.js

* fix oracle timeout request

* Enabled travis-oracledb-xe installer

Signed-off-by: Alexandre Tiertant <a.tiertant@atlantis-software.net>

* fix timeout tests

* fix timeout tests messages
2016-10-14 18:00:39 +03:00
Tim Griesser
7069ce509e Revert to generic pool (#1665) 2016-09-13 18:12:23 -04:00
wubzz
6621e3b0ce Fix promisify in knexfile.js 2016-03-15 21:14:17 +01:00
Jurko Gospodnetić
16a076c1a0 trim trailing spaces
Only left alone ones in `test/tape/transactions.js` which would just
cause unnecessary conflicts and get cleaned up by separate pull
request #1257 anyway.
2016-03-08 08:44:01 +01:00
Sky Morey
fbbda0731b removed test sqlserver from test/knexfile.js 2015-12-14 16:21:27 -06:00
Sky Morey
f99d3952a1 changed mssql to compact create format. changed unique index to unique constraint 2015-12-14 16:20:45 -06:00
Sky Morey
aa8df07711 merge 2015-12-14 11:10:46 -06:00
Sky Morey
10b415ed7d turned off mssql from build test 2015-12-14 11:01:54 -06:00
Sky Morey
371815d7e6 made SCHEMA upper case for mssql 2015-12-14 09:56:53 -06:00
Sky Morey
afd6b66624 Final build of mssql provider, all tests pass 2015-12-09 17:53:53 -06:00
Sky Morey
7c1120e0e2 in progress 2015-12-08 11:37:31 -06:00
Tim Griesser
12e6ada1a3 Fix for #805, warn for non-existent savepoints
In MySQL if a savepoint is missing, it means something
else (most likely DDL) triggered an implicit commit. In this
case rather than erroring, let's give a warning message
so it's possible to use the same codepath as a DB where
this actually works.
2015-05-01 11:26:29 -04:00
Tim Griesser
aa026613b1 Fix MariaDB Travis config 2015-04-30 21:19:52 -04:00
Tim Griesser
ff76297506 Normalize connection config, fix #789 2015-04-29 15:14:41 -04:00
Tim Griesser
f735dcb9c8 Raw identifiers and named parameters
Adds ?? for interpolating identifiers in raw
statements. Also adds raw(sql, obj) for
named :key syntax. Alternatively, 🔑
(trailing colon) may be used to specify an
identifier as a parameter.
2015-04-27 15:58:48 -04: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
c8232d11d3 Merge with master, cleanup on mysql2/maria 2015-04-22 16:19:59 -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
Ben Drucker
7cdda834ef Remove FoundationDB
Reverts c199761c597c93136a6d38bc4ecf26a693560322 and #641

Foundation was acquired and shut down immediately
2015-03-24 17:48:14 -07:00
Nathan Williams
2d6d2f28f7 Adapter for FoundationDB SQL Layer 2015-02-04 14:56:41 -05:00
Vincent Schoettke
f3874ac651 Fixed several jshint warnings. Added strict mode 2014-09-01 17:19:34 +02:00
Vincent Schoettke
36282de16b Fixed integration now close connections 2014-08-28 20:50:44 +02:00
Vincent Schoettke
9ef99b5f92 Added oracle support 2014-08-13 21:53:42 +02:00
Noah Santorello
e50378f1b7 Removed absolute migration/seed paths in test knexfile 2014-07-21 19:56:42 -04:00
Noah Santorello
690326ea33 Adding integration tests for seeds 2014-07-21 18:38:40 -04:00
Tim Griesser
ebcd13879b Allow for dialect as the options param rather than client 2014-07-09 10:36:40 -04:00