226 Commits

Author SHA1 Message Date
Olivier Cavadenti
126b84639e
Support for 'is null' in 'order by' (#3667) (#4720) 2021-10-10 22:45:48 +03:00
Igor Savin
941b660f53
Initial infrastructure for CockroachDB (#4571) 2021-10-02 23:45:17 +03:00
Jeremy W. Sherman
a9338208f1
fix(oracledb): withRecursive: omit invalid RECURSIVE keyword, include column list [#4514] (#4652) 2021-09-03 22:27:32 +03:00
wolfcomp
4c79ac1fe6
Fix Analytic orderBy and partitionBy to follow the SQL documentation (#4602) 2021-08-30 20:17:16 +03:00
Jeremy W. Sherman
40576ce430
fix(mssql): Generate valid SQL for withRecursive() [#4514] (#4639) 2021-08-25 09:36:43 +03:00
Egor Koldasov
c335fda657
#873 | implement delete with join (#4568) 2021-07-13 09:41:16 +03:00
Igor Savin
230845d3c2
Make "first" and "pluck" mutually exclusive (#4280) 2021-02-08 13:45:13 +02:00
Tyler Watson
c860b89184
WIP: Replace MSSQL dialect with Tedious.js implementation (#2857)
Co-authored-by: Tyler Watson <tyler@rapidplatform.com.au>
Co-authored-by: Igor Savin <iselwin@gmail.com>
2021-02-08 08:46:35 +02:00
Ihor Sakailiuk
09e9fa4193
Fix issue with schema usage with FROM clause contain QueryBuilder, function or Raw (#4268) 2021-02-03 19:16:00 +02:00
Ihor Sakailiuk
dbcc8a3228
Fix issue with .withSchema usage with joins on a subquery (#4267) 2021-02-03 00:23:50 +02:00
martinmacko47
50be910113
Allow optimizer hints (#4243) 2021-01-28 01:57:25 +02:00
Igor Savin
a9773b79a3
Extract static methods outside of a formatter (#4213) 2021-01-07 02:04:10 +02:00
Igor Savin
936126c0f0
Add analytic functions v2 (#4188)
Co-authored-by: CorvusCorrax <renaud.cayol@gmail.com>
Co-authored-by: Alexandre Tiertant <alexandre.tiertant@gmail.com>
2020-12-31 14:38:50 +02:00
Mark Boyd
76c131e2a9
Add support for WHERE clauses to "upsert" queries (#4148) 2020-12-09 17:51:29 +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
Nico Burns
8d43019873
Implement "UPSERT" (Postgres/MySQL/Sqlite) (#3763) 2020-10-31 17:22:52 +02:00
Ivan Zhuravlev
5845dc632f
feat(QueryBuilder): add method clear(statement) (#4051) 2020-10-29 01:18:32 +02:00
Simon Lorenz
b65245e1fe
warn if whereNot is used with 'in' or 'between' (#4038)
Co-authored-by: Simon Lorenz <simon.lorenz@stadt-duisburg.de>
2020-09-19 23:45:11 +03:00
Igor Savin
e37aeaa31c
Prepare for 0.21.0 release (#3811) 2020-04-19 00:40:23 +02:00
Edvaldo Szymonek
336b41e148
Add clearGroup method (#3771) 2020-04-13 01:09:51 +02:00
Kabir Baidhya
078b749892
Add unit tests for escape utility functions (#3742) 2020-03-22 18:44:51 +01:00
Kabir Baidhya
2800e72d2f Add tests for some of the string utility functions (#3568) 2020-01-04 22:59:41 +01:00
Igor Savin
9b37c9480b
Return more information about empty updates (#3597) 2019-12-28 22:36:14 +01:00
Edvard Chen
0560959fa4 feat: wrap subQuery with parenthesis when it appears as table name (#3496) 2019-10-28 21:38:01 +01:00
EthanHur
2d0459111d orderBy accepts QueryBuilder (#3491) 2019-10-24 16:08:12 +02:00
EthanHur
c53227564d add validation in .offset() (#2908) 2019-10-15 13:24:49 +02:00
Igor Savin
988fb24389
Fix MSSQL escaping (#3382) 2019-10-06 20:21:32 +02:00
Kristjan
4ade98980e feat: add undefined columns to undefined binding(s) error (#3425) 2019-09-04 22:59:04 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Igor Savin
e971c5198b
Update dependencies, fix new eslint errors (#3339) 2019-07-10 20:47:56 +02:00
Ricardo Maes
bc1ddcad01 Implement "skipLocked()" and "noWait()" (#2961) 2019-07-06 14:05:53 +02:00
Igor Savin
c431ffc35a
Drop support for Node.js 6. Remove babel. (#3227) 2019-06-04 00:37:17 +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
Lorefnon
54a7a4a35f Support multi-column whereIn in sqlite through values clause (#3220)
Fixes #3042
2019-05-25 12:53:20 -07:00
Daniel Mills
617d36ea01 add clearHaving function and add test (#3141) 2019-05-12 10:20:26 +02:00
Andrew Schmadel
b15ee3def1 make unionAll()'s call signature match union() (#3055)
* make unionAll()'s call signature match union()

consolidates the logic used by union() and unionAll(), allowing the two to be used interchangeably

* use spread args instead of arguments array

* Fix unionAll spread arguments
2019-03-29 19:55:32 +02:00
EthanHur
0db785949b add test that clearing offset (#2954)
* add test that clearing offset

* fix typo
2019-03-05 16:25:30 +01:00
thekuom
71e097b663 add intersect() (#3023)
* add intersect()

* update intersect integration tests to validate results

* use const instead of var, remove .only in test, remove commented out type
2019-03-03 20:57:40 +01:00
EthanHur
dfe01298d2 mysql warn .returning() does not have any effect. (#3039)
* mysql warn `.returning()` does not have any effect.

* add test if warning is emitted or not
2019-03-03 14:53:06 +02:00
EthanHur
723346f7c5 fix client typo in test script (#2912) 2018-11-16 14:36:33 +01:00
EthanHur
4db047df02 support multiple columns in .orderBy() (#2881)
* support multiple columns in `.orderBy()`

* add unit tests of order by

* orderByArray function to private

* use isString in string check
2018-11-06 22:30:06 +01:00
Casey Foster
c0838053bd Add withRecursive() (#2889)
* Add withRecursive()
2018-11-04 20:30:04 -05:00
Igor Savin
96a8e3a4d8 Add support for named unique, primary and foreign keys to SQLite3 (#2840)
* Add support for named unique, primary and foreign keys to SQLite3

* Add integration testing for named keys

* Improve tests for primary and unique keys

* Improve tests for foreign keys

* Run prettier

* Fix tests

* Fix additional test
2018-10-11 19:14:26 +03:00
Simon Lidén
66acbe7719 Allow chaining of increment, decrement, and update (#2740)
* Allow chaining of increment, decrement, and update
* Adds clearCounters
2018-10-06 10:10:56 -04:00
sgoll
1c782cf2c8 Allow table names with forUpdate/forShare (tgriesser/knex#2834) (#2835)
* Allow table names with forUpdate/forShare (tgriesser/knex#2834)

* Add integration test for partial table locks

* Simplify code of table name concatenation

* Add changelog entry
2018-10-04 09:39:24 -04:00
Tim Griesser
051bdc7e2a
whereColumn (#2837)
Adds: 
  - whereColumn
  - orWhereColumn
  - andWhereColumn
  - whereNotColumn
  - andWhereNotColumn
  - orWhereNotColumn
2018-10-03 11:26:19 -04:00
Tim Griesser
ca00ddb9c5 Revert "onVal -> onColumn for #2746"
This reverts commit b83fc4db476d596d3fb136f187cd91cb7f1dbcfe.
2018-10-03 09:32:29 -04:00
Tim Griesser
b83fc4db47 onVal -> onColumn for #2746 2018-10-02 22:49:12 -04:00
Simon Lidén
0b417e5371 Feature/join onVal andOnVal orOnVal (#2746)
* Added onVal, andOnVal, orOnVal to JoinClause
2018-10-02 22:44:46 -04:00
Simon Lidén
1616b2af0d Use columnize instead of wrap in using(). (#2713)
* 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
2018-08-29 20:43:45 +03:00