* Use columnize instead of wrap in using().
This is an attempt to fix#2136. Also added an integration test, couldn't find any existing.
* Exclude MSSQL from test as it does not support .using
* Change test to not use subquery
* Change test
* test(QueryBuilder): add test for countDistinct with multiple columns
* test: add integration test for countDistinct with multiple columns
* feat(QueryBuilder): support multiple columns for countDistinct
* feat(QueryBuilder): support object alias notation for aggregate methods
i.e. `count`, `countDistinct`, `max`, `min`, `avg`, `avgDistinct`, `sum`, `sumDistinct`
* test: fix integration tests for countDistinct
* fix(QueryBuilder): fix countDistinct formatting with multiple columns
* refactor(QueryBuilder): add _aggregate from helpers
* fix(QueryCompiler): only use parens for distinct with postgres
* test(QueryBuilder): remove unsupported tests
for count with multiple distinct columns in databases where this is
not supported
* refactor(QueryBuilder): improve readability
* Support multi-column `whereIn` with query
Add support for supplying a subquery for a `whereIn` statment on multiple columns.
Fixes#1384.
* Fixed method
* Removed duplicate import
* Fixed isArray calls and linter warnings
* Fixed isArray call
* Fixed tests and added assertions for all dialects
* 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
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')"));
```
* 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
* adding support for ONLY keyword for PostgreSQL as an optional flag of from() and into() through table(tableName, only)
* passing only parameter from default function was missing
* changing only option to options object with only key
* better style per @wubzz suggestion
* 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