* 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
* 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
* Update dependencies. Tweak ESLint rules to work more like they used to before
* Fix indentation
* Remove unnecessary escapes.
* Remove unused 'usingClause' parameter.
* Address CI failures.
* Revert "Remove unused 'usingClause' parameter."
This reverts commit aaa4d71e914faa1c4c1313c26bbdd26067b0b448.
* eslint: add ignore with todo
* dependencies: update
* Fixing issue with add columns on tables failing if using both after and collate
* Adding tests for collate modifier alongside first and after modifiers
* Make postgres client wrapIdentifierImpl independent of `this` context
* Also fixes a bug where only single digit indices were accepted.
* add customWrapIdentifier helper for client
* customWrapIdentifier is one more level of abstraction for the wrapIdentifier "pipeline"
that allows the custom wrapIdentifier to be called without calling the `wrapIdentifierImpl`
* bufix: use custom wrapIdentifier in columnInfo. fixes#2402
* 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
* Throw error on non-string table comment
* add unit tests for all dialects
* removed non-valid comments retyping to ''
* Change dockerode version
* reverted dockerode version locking
* added object syntax for aliases
* added mixed tests for alias pair feature
* fixed double aliasing for subqueries
* fixed last untested commit
* Added support for passing query builder inside object syntax and using the syntax in raw identifiers
The aggregate methods include `count`, `min`, `max`, `sum`, `avg`,
`countDistinct`, `sumDistinct`, and `avgDistinct`, all of which
can now receive raw expressions, e.g.
```js
knex('users').count(knex.raw("data->'active'"));
```
There seems to be some demand for this, and I think it's cleaner than the alternative of
```js
knex('users').select(knex.raw("count(data->'active')"));
```
* Fix connection error propagation when streaming
If stream() is used without a handler, make sure to emit connection
errors on the stream itself.
* Test stream error emission
* Improve test
* Removed check increments check on the modifiers. Implemented a default lookup map on the generic columncompiler
* Ignore VS Code User Workspace Settings
* Added test case to assert comments are added to increments columns
* Shortened line length and added explicit db tests for postgres and mysql dialects
* Added check for modifiers on incrementing types and only allow comment modifiers
* Exposed also positionBinding method to client base class and refactored calls to em
* Added toSQL().toNative() getter which returns dialect specfic sql and bindings.
* Refactored toSQL method implementation
* Added `loadExtensions` parameter to filter which migrations and seeds will be executed
* `loadExtensions` now includes all supported extensions by default
Also added unit tests for modified code
* 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.
* Tests for setting comment on table for postgresql, mysql and oracle
* No tests for sqlite as it does not seem to support comments
* No tests for mssql as it can not be tested simply using sql comparison
* Test composition of two cross joins
* Test cross-join with 'on' statement
(same as inner join) only for sqlite3 and mysql
because not supported elsewhere
* 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
* fixed table alter attribute order. (first, after)
* add test cases, alter table position with comment.
* add real database test cases.
* after, first tests only mysql or mariadb.
* Add optional parameter fetchAsString to oracledb
* Add some checks to oracle fetchAsString
* use const instead of let
* add fetchAsString test
* change const to var in tests
* move oracle driver specific test to bottom
* fix fetchAsSting multiple instance
* Fix tests
* replace const to var in test
* Rework Oracle fetchAsString tests
* remove const
* remove done and timeout
* Use transaction for entire migration batch + locking if all migrations are transactional.
* Fix tests.
Use knex instead of query builder.
Do no use single transaction if `disableTransactions` is true.
* Added tests for parallel migrations.
Subtract already done migrations after getting the lock, when there is a wrapping transaction.
* Fix indentation.
* Fix linting errors (which are locally warnings, for some reason).
* Remove `const` keyword.
Remove obsolete `it` clauses.
* No maria. PG first.
* Test only pg and oracle.
* Remove error swallowing.
* Test parallel migration only in postgres (select for update works differently in other databases).
* Add transaction to missed places.
* Remove ignored table name argument.
* Enabled parallel migrations test for `mssql` dialect (still not part of CI test).
Fixed indentation.
* # This is a combination of 3 commits.
# The first commit's message is:
Allow passing config.version variable to knex instead of parsing the DB version from string returned form DB server.
This makes it possible to connect custom databases which are compatible with an official database of certain version.
# The 2nd commit message will be skipped:
# Update checkVersion
#
# To use `const` instead of `let` to fix lint error
# The 3rd commit message will be skipped:
# Revert "Update checkVersion"
#
# This reverts commit 248907decb94f0df2f2b3b9fe114738fb48394fc.
* Allow passing config.version variable to knex instead of parsing the DB version from string returned form DB server.
This makes it possible to connect custom databases which are compatible with an official database of certain version.