994 Commits

Author SHA1 Message Date
wubzz
50557f7571 Ensure errors in batchInsert do not end up 'unhandled'. Fixes #1880 (#1984) 2017-03-22 21:44:36 +01:00
wubzz
b722753ea3 Transaction should not reject with undefined. (#1970) 2017-03-14 21:56:32 +01:00
Alec Hirsch
9404dba928 added clearSelect and clearWhere to query builder (#1912) 2017-02-20 20:12:14 +02:00
vellotis
fe4ec15ae0 Support custom foreign key names (continued work of #1311) (#1726)
* Added support for custom foreign key name

* Update unit test for #1311

* Fix TableCompiler::foreign to respect previous behavior + typo

* Add dialect specific unit tests

* Fixed comment

Actually trying to trigger travis to run tests with latest travis configuration... (maybe it just doesn't run tests against merged branch..)
2017-02-17 00:35:43 +02:00
Mikael Lepistö
77e67334a3 Alter column syntax for table, implements changing type, nullability and default (#1914)
* Added support for altering columns

* Add mysql dialect key for alter (modify)

* Added tests for .alter()

* Updated dialects for .alter() on column

* .alter() for mssql and tests

* Added an error for sqlite3 alter column

Sqlite does not support alter column at all

* Implemented schema alter column support for postgresql

* Added unit test for alter column and fixed postgres implementation

* Add test case for adding multiple columns at once (oracle check)

* Try upgrading CI mysql / postgres and distro

* Disabled adding multiple columns test from oracle

* Fixed node 0.12 test compatibility

* Fixed review comments
2017-02-16 20:34:59 +02:00
Mathew Gardner
f198c7d574 Allow casting when using named bindings. (#1890)
* Allow casting when using named bindings.

* Remove template string in test.

* Only replace matches that are member to the bindings object.

* Slight refactor for tests.

* Simplify regex.

* Allow casting on named identifiers.
2017-02-05 20:22:26 +02:00
Tim Huff
0d55cfd286 More promise functions (#1896)
* Added failing tests

added more promise tests

* Added ability to use promise functions

* removed identity from promise handler
2017-02-04 02:54:15 +02:00
Justin Huntington
2fa375f813 Pass rollback errors through to transaction promise in mssql dialect (#1884) (#1885)
Check for rollback failures on mssql and pass them through to the transaction promise-- attaching the underlying cause as an 'originalError' property.  This fixes a hang when mssql server aborts a transaction and the client issues a rollback.
2017-01-30 15:00:03 -06:00
Tomás Pinho
7de07c966a ONLY keyword support for PostgreSQL (#1874)
* 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
2017-01-26 18:22:09 +02:00
Mikael Lepistö
49aa6f7314 Check that oracle DB testing is enabled before running ext auth tests. Fixes #1865 (#1867) 2017-01-16 11:05:35 +02:00
wubzz
a4bfee7751 Ensure that 'client' is provided in knex config object (#1822)
* Ensure that 'client' is provided in knex config object

* sqlite3 columncompiler: Assign 'modifiers' --after-- super() call.

* oracle columncompiler: Assign 'modifiers' --after-- super() call.
2016-12-11 18:23:44 +02:00
Ruben Slabbert
0ae4f3ef95 Mssql update query generates invalid syntax (#1777)
* Updated mssql update compiler with correct syntax

* Updated failing mssql test

* Updated failing tests to add from

* Third times the charm tests
2016-12-06 20:04:30 +11:00
Nikita Khomyakov
6789ffe7a3 Fix erroneous float to integer conversion of decimal fields in MSSQL (#1781)
* Fix erroneous float to integer conversion of decimal fields in MSSQL

* Add test case for decimal number handling in MSSQL
2016-11-30 07:55:58 -06:00
Kasun Talwatta
da5ed96825 Adding external authentication capability when using oracledb driver (#1716)
* Adding external authentication capability as mentioned in https://github.com/oracle/node-oracledb/blob/master/doc/api.md#extauth

* Add unit test for externalAuth

* Cover the connection string part

* Update documentation

* fix spaces

* Hide the fake Oracle server error

* minor grammar changes and spaces changes
2016-11-30 09:44:43 +02:00
Mikael Lepistö
4068a8757c Fixed random timeout test failure to wait before testing if connection really has been canceled 2016-11-29 13:01:39 +02:00
Owen Evans
825396ada7 use uuid not node-uuid (#1792) 2016-11-22 10:58:21 +02:00
skarbovskiy
9848145f46 allow to use first method as aliased select (#1784)
* allow to use first method as aliased select

* added test case for allow `first as` syntax
2016-11-18 13:43:39 +02:00
Alexandre Tiertant
3609de76b3 fix oracle tests (#1741)
* Fix Oracle dialect to pass integration tests$

* Update transaction.js

* fix oracle timeout request

* Enabled travis-oracledb-xe installer

Signed-off-by: Alexandre Tiertant <a.tiertant@atlantis-software.net>

* fix timeout tests

* fix timeout tests messages
2016-10-14 18:00:39 +03:00
Tim Griesser
f2215c40d8 Updating/pruning some deps 2016-10-12 01:05:08 -04:00
Tim Griesser
5890e4d4ea Fix #1733, #920, incorrect postgres array bindings 2016-10-12 00:43:30 -04:00
Tim Griesser
454b769a10 Fix test suite for node 0.12 2016-10-09 18:26:04 -04:00
Tim Griesser
188796554e Fix test suite for node 0.12 2016-10-09 17:51:13 -04:00
Tim Griesser
dc431f8afc Fix test for acquireConnectionTimeout 2016-10-09 17:33:52 -04:00
Tim Griesser
a24e4df638 More test suite fixes 2016-10-09 15:21:04 -04:00
Tim Griesser
82685b57f0 Fix test in 0.12 2016-10-09 15:09:54 -04:00
Tim Griesser
fa30dfb858 Fix #1710 2016-10-09 14:33:51 -04:00
Tim Griesser
3a3cad9f88 Fix #1694 2016-10-09 14:33:51 -04:00
Alexandre Tiertant
67b62d3213 Add having() and on() missing methods and corresponding tests/doc (#1674) 2016-09-19 19:20:12 +03:00
Tim Griesser
7069ce509e Revert to generic pool (#1665) 2016-09-13 18:12:23 -04:00
Tim Griesser
3a5250d87d Fix #1619 2016-09-13 09:56:53 -04:00
Tim Griesser
143e09ad35 Fix use of const in test suite for node 0.12 2016-09-13 09:50:28 -04:00
Tim Griesser
48a2ee1648 Deprecate Knex.Promise 2016-09-13 08:19:47 -04:00
Tim Griesser
6266037a38 Merge branch 'master' into 0.12-prep
* master:
  add With Clause (#1599)
2016-09-13 08:16:30 -04:00
Tim Griesser
f5bad1ae54 Simplifying internal client structure 2016-09-13 08:15:58 -04:00
Alexandre Tiertant
69235aed73 add With Clause (#1599)
* Add "with" clause

* Add arguments check to with() and modify some tests

* fix test
2016-09-13 13:14:04 +03:00
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
Alexandre Tiertant
57a67cdadc Fix #906 Oracle auto increment manual insert id (#1526)
* Oracle sequence trigger handle manual id inserts

* Update schema tests
2016-09-12 10:52:14 +03:00
Tim Griesser
6fa485302b Bluebird cleanup (#1618)
* Reference Bluebird directly, Remove deprecated .exec method
* Remove outdated bench scripts
* Remove old .jshintrc file
2016-08-09 17:23:07 -04:00
Tim Griesser
4d056845b9 Remove outdated bench scripts 2016-08-09 17:11:08 -04:00
Nick Whiteley
f969d5236a MSSQL columnInfo() had hard coded schema name (#1585)
* MSSQL columnInfo() had hard coded schema name

* Change let to const for columnInfo bindings array
2016-07-26 10:00:57 +02:00
statyan
6ecd8f3793 Fixed knex #1577 (#1578)
* Fixed knex #1577
Aslo corrected tests for primarykey

* Fix for installing from github

* Fix for installing from github

* Fix for installing from github
2016-07-20 11:22:17 +10: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
David Overcash
6193701c8d Typo. 2016-06-17 11:04:35 -07:00
David Overcash
9ec6984cc3 Fix a test that wasn't able to compare with new __knexQueryUid field. 2016-06-17 10:57:03 -07:00
David Overcash
f5137f2d67 Remove failing test to verify theory. 2016-06-17 10:42:40 -07:00
David Overcash
a8cbbfc193 Add tests for __knexQueryUid and an additional test for the query event. 2016-06-17 09:53:54 -07:00
Mikael Lepistö
cd28114067 Made test timeout to be configurable by setting KNEX_TEST_TIMEOUT environment variable. 2016-06-14 19:02:43 +03:00
Rhys van der Waerden
d3557a0e36 Merge pull request #1473 from robscott/fix/passwordless_database_url
Adding support for specifying a DATABASE_URL without a password
2016-06-13 22:28:08 +10:00