131 Commits

Author SHA1 Message Date
Tim Griesser
ee217ce2a1 Fix PG string escaping behavior (#1661)
* 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
2016-09-12 18:01:47 -04:00
Trevor Smith
b1a95b181e Allow named bindings to be escaped. (#1576)
* Allow named bindings to be escaped.

* Use a literal for the named parameter binding regex.
2016-07-19 20:42:49 +03:00
Dmitry Vdovin
289f17e21b Fix incorrect escaping of backslashes in SqlString.escape (#1545) 2016-07-02 00:45:50 +03:00
Alexandre Tiertant
53d089bffb add node-oracledb support (#990)
* add node-oracledb support

* move file in src directory

* remove unused var

* correct pool release
correct date error

* correct bugs

* add some test

* correct a test error

* correct time zone error in schema tests

* correct time zone error in schema tests

* use inheritance to remove duplicated code

* use inherit in formatter to remove dupplicated code

* remove unused code

* remove unused require

* add blob insert support

* add queryCompiler to dialect prototype

* export queryCompiler

* fix bugs

* Correct tests

* handle returning

* clean code

* clean code

* Fix returning

* Multiple insert with blob

* Add SELECT BLOB support

* Finalise update

* Fix test error

* Fix insert error without returning

* Add transaction and code cleaning

* build

* Fix pool ping error

* Add missing rejecter

* build

* Fix error in delete

* Fix transaction rollback error throwing

* Fix typo in commit

* Fix rollback rejecter

* Remove BLOB tests

* remove lib file

* fixed oracledb linter errors

* Add .completed to transaction acquireConnection()
2016-06-20 18:03:52 +03:00
wubzz
1fe657ab72 Fix test for undefined bindings and add documentation 2016-05-30 21:17:45 +02:00
wubzz
636a446b6d Made the compiler's where function be the source of the validation, but the toSQL function is still the 'thrower'. 2016-05-30 20:09:16 +02:00
wubzz
cba2cdc364 Check for undefined bindings in SELECT queries and RAW queries during compile and throw an error. 2016-05-28 19:45:00 +02:00
wubzz
f097e9147b Make sure 'raw' respects the "not" flag in the query builder. Fixes #1402 2016-05-14 22:36:13 +02:00
Rhys van der Waerden
a06b44a29c Merge pull request #1397 from atiertant/join-nest-statements
Allow joins to nest conditional statements
2016-05-14 11:19:51 +10:00
Mikael Lepistö
9114bdd8b3 Changed implementation of replacing undefined with DEFAULT already in query compiler for every dialect. 2016-05-12 10:24:42 +03:00
Mikael Lepistö
9fab58c2b2 Evaluated multi insert default for undefined already in query compiler 2016-05-12 10:24:42 +03:00
Alexandre Tiertant
f3c78f6c85 add test 2016-05-12 09:09:42 +02:00
wubzz
34d9a7650e Merge pull request #1269 from wubzz/bugfix/fix_valuesForUndefined_actual_query
Fix valuesForUndefined actual query being executed. Fixes #1268
2016-03-27 17:28:41 +02:00
Ryan Fink
dc92ff2b71 Merged upstream 2016-03-24 09:22:07 -04:00
wubzz
02281ef91b Fix valuesForUndefined actual query being executed. Fixes #1268 2016-03-15 21:47:58 +01:00
wubzz
b614a2f81c Update regex for named bindings 2016-03-11 20:41:19 +01:00
Rod Calumpong
ab003ac7c9 Allow returning to be used with oracle update 2016-03-07 16:35:04 -08:00
wubzz
942877c0fe OrWhere({..}) Treat as 'AND', not 'OR'. Fixes #1118 2016-02-18 06:28:14 +01:00
Rhys van der Waerden
5ebbeb07b4 Merge branch 'bugfix/make_raw_backwards_compatible' of https://github.com/wubzz/knex into wubzz-bugfix/make_raw_backwards_compatible 2016-02-06 14:08:30 +11:00
wubzz
c75f8e25e8 Added test for JS Date 2016-02-04 16:58:35 +01:00
Alejandro Oviedo
a1e6dbb0f7 fixes bug when using dot in as identifier 2016-02-02 14:46:18 -03:00
Mikael Lepistö
79a77ac932 Removes object keys with value undefined from being added to DB in update. Clean version of pq #962 fixes issue #961. 2016-02-01 11:51:02 +02:00
wubzz
0d20e5b534 .raw bindings should allow single Non-Array values. 2016-01-30 14:52:07 +01:00
gmichael225
b130ad66e2 Merge remote-tracking branch 'root/master' into sqlite3-dialect-escaping
# Conflicts:
#	lib/dialects/sqlite3/index.js
2016-01-25 07:43:03 +11:00
Ryan Fink
4985a65bfc Add syntactic sugar - andWhereBetween and andWhereNotBetween 2016-01-09 07:35:12 -05:00
gmichael225
4b2c0efff1 SQL compliant escaping, removed dialect-specific escaping for now 2015-12-24 11:33:48 +11:00
Sky Morey
eed0004031 mssql: added top (?) back to fix that error. also removed loading of empty file 2015-12-15 16:48:19 -06:00
Sky Morey
ae256f2943 mssql limit and offset for sql2012 2015-12-15 14:56:56 -06:00
Sky Morey
aa8df07711 merge 2015-12-14 11:10:46 -06:00
Michael G
91b159db2d Added test for SQLite single-quote escaping as per http://www.sqlite.org/lang_expr.html 2015-12-14 18:38:56 +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
Brian Black
27b0a57823 do not escape doublequotes in postgres 2015-11-29 18:54:05 -05:00
Brian Black
332ed3b811 tests for escaping single-quotes 2015-11-29 18:44:12 -05:00
Rhys van der Waerden
51ef27bd4f Merge pull request #1058 from elhigu/support-question-mark-escaping-for-knex-rendered-queries
Support question mark escaping for knex rendered queries
2015-11-28 13:47:53 +11:00
Mikael Lepistö
30d42ebab9 Replace undefined with DEFAULT by default and NULL with separate configuration option. 2015-11-14 19:46:34 +02:00
Mikael Lepistö
0c74f786a5 Optionally use DEFAULT instead of NULL when translating undefined to SQL value. 2015-11-14 19:46:34 +02:00
Mikael Lepistö
db7e7feb2f Documentation and test 2015-11-14 11:07:43 +02:00
Rhys van der Waerden
bd97610940 Merge pull request #1046 from ErisDS/issue-1028
Distinct modifier support for aggregate functions
2015-11-10 00:06:02 +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
Chuy Del Castillo
6e7049c8bd checking for plain object instead object 2015-11-06 16:17:50 -07:00
harriha
5003b41dae Add tests for a join with value 0 2015-08-30 23:21:11 +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
4f833dae42 Unit test for queryBuilder.compose 2015-07-09 15:59:29 +01:00
Tim Griesser
0c0864761c Test and fix for #749 2015-04-24 10:31:23 -04:00
Tim Griesser
36ced91ed5 Testing transactions, beginning to use tape, adding query to error message 2015-04-24 10:10:34 -04:00
Tim Griesser
26726c728b Fixing test config 2015-04-22 12:11:23 -04:00