57 Commits

Author SHA1 Message Date
Igor Savin
9c390036db
Move "parameter" out of formatter (#4275) 2021-02-04 15:54:26 +02:00
maximelkin
b9fb5992b5
Migrate to classes (#4253) 2021-01-31 12:40:13 +02:00
Lorefnon
e107ceacfc
Make toSQL().toNative() work for Raw to match the API for QueryBuilder (#4058)
Co-authored-by: Igor Savin <iselwin@gmail.com>
2021-01-02 16:26:29 +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
ad41e1c0f4
Minor code improvements (#4167) 2020-12-20 01:43:36 +02:00
Igor Savin
26f3e5d62d
Replace uuid with copied nanoid logic (#4089) 2020-10-30 14:21:17 +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
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
Thomas Sondergaard
c277edbaf1 Use more efficient algorithm for generating internal ids (#3595) (#3596) 2019-12-27 20:16:38 +01: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
Mikael Lepistö
7140a48226 Remove generated lib from repository and run build in prepublish 2016-01-21 09:59:30 +02:00
Sky Morey
7c1120e0e2 in progress 2015-12-08 11:37:31 -06:00
Mikael Lepistö
e2eacc7d6e Ran 'npm run build' since tape tests would not pass if build is not updated. 2015-11-10 23:27:26 +02:00
Chuy Del Castillo
6e7049c8bd checking for plain object instead object 2015-11-06 16:17:50 -07:00
Tim Griesser
cf757a5647 Fix #853, raw bindings should be optional 2015-06-01 07:30:38 -04:00
Tim Griesser
521a6f9e97 Remove use strict, assumed in ES6 2015-05-09 14:01:19 -04:00
Tim Griesser
7e884cb325 Babel src -> lib, remove gulp 2015-05-09 13:58:18 -04:00
Tim Griesser
3482c650d4 Improvements to object value bindings 2015-05-06 10:48:05 -04:00
Tim Griesser
3e1872731e Fix for #605, options preserved in standalone Raw query 2015-04-30 18:07:16 -04:00
Tim Griesser
e011768124 Adding back debug 2015-04-28 19:34:11 -04:00
Tim Griesser
348c0246fb Fix bindings length check 2015-04-27 16:50:52 -04:00
Tim Griesser
f735dcb9c8 Raw identifiers and named parameters
Adds ?? for interpolating identifiers in raw
statements. Also adds raw(sql, obj) for
named :key syntax. Alternatively, 🔑
(trailing colon) may be used to specify an
identifier as a parameter.
2015-04-27 15:58:48 -04:00
Tim Griesser
f9aab9dc76 Major internal refactor
Beefed up transaction implementation, still needs tests
and cleanup of nested transaction queues.

Left todo:
- Fix commented out tests
- Fix oracle driver's transactions
2015-04-22 10:34:14 -04:00
Tim Griesser
eee4e9c005 Fixing the overall class dependency approach, lots of internal cleanup, WIP 2015-04-19 16:31:52 -04:00
Vincent Schoettke
f3874ac651 Fixed several jshint warnings. Added strict mode 2014-09-01 17:19:34 +02:00
Tim Griesser
c07970ee7e Extract raw query formatting from constructor 2014-08-14 18:02:13 -04:00
Tim Griesser
d925ab569a Use reduce context rather than .bind 2014-08-14 15:59:02 -04:00
Sohum Banerjea
45748bb257 bugfix: index disruption 2014-07-18 10:22:36 +10:00
Sohum Banerjea
4904a7f320 Only nest raws when the sql is a string 2014-07-17 18:51:36 +10:00
Sohum Banerjea
a638a54f78 Allow nested Raw queries
* Do the recursive step on constructor
* Splice in parameter strings based on ? indexes
* Concat bindings
2014-07-17 17:26:40 +10:00
Tim Griesser
6af64d32a1 Adding support for mysql2, https://github.com/sidorares/node-mysql2 2014-06-09 16:27:03 -04:00
Tim Griesser
32a6a83a5a Add support & document raw.wrap 2014-06-09 15:26:48 -04:00
Tim Griesser
d7738e772a Fixing comment & foreign key tests, full suite passing 2014-05-29 17:31:09 -04:00
Tim Griesser
5b9336a284 sqlstring now pulled from node-mysql, pq queries escaped 2014-05-06 18:15:16 -04:00
Tim Griesser
2f6a42dd5e event emitters everywhere, standard 'query' event 2014-04-27 19:35:36 -04:00
Tim Griesser
4dee91551a all unit tests passing 2014-04-15 13:10:32 -04:00
Tim Griesser
a62ca4f7ee schema tests passing, some of the builder tests passing 2014-04-15 11:43:47 -04:00
Tim Griesser
9be8b41efa streams and things 2014-04-09 10:11:41 -04:00
Tim Griesser
dfdc426751 Majorly refactoring every piece of the library, WIP 2014-04-08 16:25:57 -04:00
Tim Griesser
eeeab07c42 reworking where values are parametereized/escaped 2014-03-14 16:56:55 -04:00
Tim Griesser
55f7f28761 making stateless querying opt-in, not default 2014-02-22 17:06:33 -05:00
Tim Griesser
549036d151 working on handling the statements 2014-02-21 17:16:11 -05:00
Tim Griesser
4c589cc960 working on refactoring the internals 2014-02-14 12:46:13 -05:00
Tim Griesser
3c8d08a64b Removing unnecessary UMD
When this eventually enabled on the client side,
we can build this into the build script.
2013-11-27 16:51:01 -05:00
Tim Griesser
667a20b66e switching out underscore for lodash 2013-11-25 02:00:12 -05:00
Tim Griesser
2d1c0f019d fix for internal mutation of builder on multiple toSql calls 2013-09-24 08:14:02 -04:00