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.
* 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
* 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
* 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
* 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
* Checks for an empty, undefined or null object on transacting
Fixes https://github.com/tgriesser/knex/issues/2079
Those values indicates that the developer probably made a mistake.
* Fix message assertions
* 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
* feat(query-builder): add hookContext for wrapIdentifier
* refactor: use isUndefined
* test(transaction): test passing of hookContext
* feat(runnner): pass context to postProcessResponse
* test(runner): test postProcessResponse for raw responses
* test(raw): test passing of hookContext
* feat: add hookContext to Raw and SchemaBuilder
* test(transaction): fix test for hookContext
* chore: fix lint error
* fix: check for hookContext before calling it
* test(transaction): fix hookContext test
* chore: remove whitespace
* test(hookContext): test cloning of context object
* refactor: hookContext -> queryContext
* minor: use more descriptive variable name
i.e. refactor: `context` => `queryContext`
* fix: remove unnecessary checks for query builder
* fix(Raw): pass query builder to formatter
* fix(SchemaCompiler): pass schema builder to formatter
* refactor: add addQueryContext helper
* feat: add queryContext to TableBuilder and ColumnBuilder
* fix(TableCompiler): pass table builder to formatter
* fix(ColumnCompiler): pass column builder to formatter
* fix(pushQuery): fix passing builder to formatter
* test(Schema|Table|ColumnCompiler): test passing queryContext
* fix(SchemaCompiler): pass queryContext to TableCompiler
* fix(TableCompiler): pass queryContext to ColumnCompiler
* test: add queryContext tests for all schema dialects
* test(TableCompiler): test overwriting queryContext from SchemaCompiler
* test(Raw): test passing queryContext to wrapIdentifier
* tests: run all the tests
Check for rollback failures on mssql and pass them through to the transaction promise-- attaching the underlying cause as an 'originalError' property. This fixes a hang when mssql server aborts a transaction and the client issues a rollback.
Beefed up transaction implementation, still needs tests
and cleanup of nested transaction queues.
Left todo:
- Fix commented out tests
- Fix oracle driver's transactions