187 Commits

Author SHA1 Message Date
Igor Savin
cd6479bf0b
More formatter cleanup (#4218) 2021-01-07 23:34:46 +02:00
Igor Savin
d78c65921f
More formatter extraction (#4215) 2021-01-07 17:48:14 +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
Igor Savin
2aec21ed5e
Try to introduce some organization into how files are grouped (#4178) 2020-12-28 16:55:08 +02:00
Igor Savin
6a862e9459
Extract query execution-related code from client (#4175) 2020-12-27 15:19:47 +02:00
Kkmatt11
629909475c
Fix MSSQL with returns on inserts and deletes on tables with triggers (#4152) 2020-12-18 01:12:04 +02:00
Nico Burns
8d43019873
Implement "UPSERT" (Postgres/MySQL/Sqlite) (#3763) 2020-10-31 17:22:52 +02:00
Igor Savin
26f3e5d62d
Replace uuid with copied nanoid logic (#4089) 2020-10-30 14:21:17 +02:00
Ivan Zhuravlev
5845dc632f
feat(QueryBuilder): add method clear(statement) (#4051) 2020-10-29 01:18:32 +02:00
Bogdan Chadkin
80355e4850
Replace inherits package with builtin utility (#4059) 2020-10-05 23:59:12 +03:00
Bogdan Chadkin
6f817a3b6e
Avoid lodash typecheks (#4056)
* Avoid lodash typecheks

Lodash is quite big project. Even with direct imports it loads [tons](https://github.com/knex/knex/pull/3804) of
code and still bloats node_modules. Especially since lodash mostly used
as a polyfill for modern features.

In this diff I attempted to reduce lodash usage by replacing type checks
with `typeof` operator which might be sufficient.

Also replaced lodash/isObject with custom simplified utility which does not
consider functions as objects and allows to simplify code in one place.
2020-10-05 21:29:39 +03: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
tkalliom
02d94d96b0
Reduce size of lodash in bundle (#3804) 2020-04-18 19:41: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
Igor Savin
85888ce3c2
Prepare to release 0.20.11 (#3689) 2020-03-05 21:43:57 +01:00
Lorefnon
589ea747c2
Update QueryCompiler implementation to use classes (#3647) 2020-02-01 17:22:00 +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
4feefdf3d2 Enforce Unix (lf) line terminators (#3598) 2019-12-29 20:28:40 +01:00
Igor Savin
9b37c9480b
Return more information about empty updates (#3597) 2019-12-28 22:36:14 +01:00
Thomas Sondergaard
c277edbaf1 Use more efficient algorithm for generating internal ids (#3595) (#3596) 2019-12-27 20:16:38 +01:00
Lorefnon
f87b28c3e3 Add support for distinct on for postgres (#3513)
Resolves #3472
2019-11-11 00:51:47 +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
Igor Savin
516b074790
Enable linting in CI (#3450) 2019-10-06 20:20:46 +02:00
Kristjan
4ade98980e feat: add undefined columns to undefined binding(s) error (#3425) 2019-09-04 22:59:04 +02:00
Felix Mosheev
8111bb3ee8 Feat: Allow to extend knex query builder (#3334) 2019-07-23 20:45:03 +02:00
Igor Savin
49456691d8
Update dependencies (#3366) 2019-07-23 18:00:13 +02:00
Lorefnon
3e1a5ee0de Minor enhancements around aliasing of aggregates (#3354)
- Allows an options object to specify alias (as suggested in https://github.com/tgriesser/knex/issues/3315#issuecomment-507439215) (Closes #3315)
- Allows multiple aliases when using object syntax (Closes #2871)
2019-07-16 18:48:28 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Mikael Lepistö
7140a48226 Remove generated lib from repository and run build in prepublish 2016-01-21 09:59:30 +02:00
Sky Morey
aa8df07711 merge 2015-12-14 11:10:46 -06:00
Sky Morey
f9a9bddb5d lib files. lib should really be moved to the .gitignore since babel creates them 2015-12-10 15:22:29 -06:00
Sky Morey
4f340d6096 Merge branch 'master' of github.com:tgriesser/knex 2015-12-10 15:16:23 -06:00
Rhys van der Waerden
84472e6e7e Merge pull request #1081 from tgriesser/fix/1080
Include `_debug` property in `QueryBuilder#clone`.
2015-12-10 15:31:14 +11: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
Rhys van der Waerden
8ef5d5899d Include _debug property in QueryBuilder#clone.
Adds a test for `QueryBuilder#clone`. Changes `clone()` behaviour to transfer the debug flag (`QueryBuilder#_debug`) to the cloned instance.

Fixes #1080
2015-11-30 00:21:08 +11:00
Hannah Wolfe
f72892b5b9 Distinct modifier support for aggregate functions
closes #1028

- add support for count(distinct *), avg(distinct *) and sum(distinct *)
- min and max don't really make sense with distinct, so didn't add those
2015-11-09 12:48:42 +00:00
harriha
478b03e106 Update lib/ via running 'npm run dev' 2015-08-30 23:34:09 +03:00
Mikael Lepistö
fef0a09197 Did npm run build 2015-08-25 10:23:34 +03:00
Daniel Teixeira
8e780a8115 rename .using to .withSchema 2015-08-14 19:17:06 -03:00
Daniel Teixeira
17df5c6542 add basic schema support on queries 2015-08-09 20:38:26 -03:00
Jani Evakallio
cb89930155 Add queryBuilder as first parameter to queryBuilder.modify 2015-07-16 15:49:30 +01:00
Jani Evakallio
299bbfa60b Rename compose to modify 2015-07-16 15:15:04 +01:00
Jani Evakallio
de8a2e5da6 Commit babel artifacts for queryBuilder.compose 2015-07-09 16:10:14 +01:00