2646 Commits

Author SHA1 Message Date
Lucas Lacroix
d18b8158d5 Update documentation for table.foreign 2016-03-08 11:20:22 -05:00
wubzz
4a0456404a Merge pull request #1260 from wubzz/bugfix/add_timeout_to_raw_and_fix_test
Add .timeout to raw, and attempt to fix the timeout test
2016-03-08 13:54:54 +01:00
wubzz
3bf1256bf8 Add .timeout to raw, and attempt to fix the timeout test 2016-03-08 13:32:55 +01:00
wubzz
7cc827f6cf Merge pull request #1258 from jurko-gospodnetic/code-cleanup
Code cleanup (trimmed trailing spaces & removed tabs)
2016-03-08 13:13:48 +01:00
wubzz
4ef7759da5 Merge pull request #1250 from ngoctranfire/bugfix/fixes_inTable_undefined_fails_silently_#1220
Fixes inTable(undefined) silently fails bug from Issue #1220
2016-03-08 12:36:34 +01:00
Ngoc Tran
ac294c5d47 Renamed table name to more accurately reflect test. 2016-03-08 01:31:22 -08:00
Ngoc Tran
755ad78df4 Fixes #1220 bug to now throw TypeError if parameter passed into inTable() is not typeof === 'string'. 2016-03-08 01:28:58 -08:00
wubzz
7b2c46f383 Merge pull request #1253 from AiNoKame/feature/oracle-update-returning
Allow returning to be used with oracle update
2016-03-08 09:21:51 +01:00
Jurko Gospodnetić
16a076c1a0 trim trailing spaces
Only left alone ones in `test/tape/transactions.js` which would just
cause unnecessary conflicts and get cleaned up by separate pull
request #1257 anyway.
2016-03-08 08:44:01 +01:00
Jurko Gospodnetić
0a4a1969b4 convert tabs to spaces 2016-03-08 08:25:38 +01:00
Jurko Gospodnetić
20843aa8d6 document handling errors thrown from an exception handler function 2016-03-08 08:24:34 +01:00
Jurko Gospodnetić
96bd74e0c1 remove now redundant test case
Already covered directly by the `transaction rollback on error throw`
test case.
2016-03-08 08:05:17 +01:00
Jurko Gospodnetić
3225ab45bc test transaction callback throwing an error 2016-03-08 07:50:54 +01:00
Jurko Gospodnetić
84f85beb73 sync knex & DB transaction state on trx callback error throw
Previously throwing an error directly from a transaction callback
resulted in knex reporting that transaction's promise as rejected, and
releasing used connection (back to the connection pool), but not
telling the database to roll back that connection's transaction.
2016-03-08 07:50:20 +01:00
Jurko Gospodnetić
3d8131b5eb add missing tape assertion descriptions
The default `should be equal` description is not of much use in tracking
down failed assertions.
2016-03-08 07:50:20 +01:00
Jurko Gospodnetić
85b780d4fa sync test comments about oracle & mssql not reporting BEGIN/ROLLBACK as queries 2016-03-08 07:50:19 +01:00
Rod Calumpong
ab003ac7c9 Allow returning to be used with oracle update 2016-03-07 16:35:04 -08:00
wubzz
12d0a0d74c Merge pull request #1252 from jurko-gospodnetic/code-cleanup
Code cleanup
2016-03-07 16:33:13 +01:00
Jurko Gospodnetić
711e6605ee remove extra empty lines 2016-03-07 16:10:38 +01:00
Jurko Gospodnetić
6fc48ff835 correct stale transaction promise related implementation comment
There is no requirement that a promise returned from a transaction callback
be in any way directly related to the passed in transaction object, contrary
to what was being implied by the original comment.
2016-03-07 16:10:38 +01:00
Jurko Gospodnetić
897f31c6e5 fix incase --> in case comment typos 2016-03-07 16:10:38 +01:00
Jurko Gospodnetić
65e26ed324 fix inconsistently styled comments (missing trailing dots) 2016-03-07 16:10:37 +01:00
wubzz
a5ece5e2df Merge pull request #1226 from jurko-gospodnetic/fix-nested-transactions
Fixed nested transactions
2016-03-07 14:54:04 +01:00
wubzz
cddb64c94d Merge pull request #1231 from wubzz/feature/add_event_query-response
Add 'query-response' event (#1203)
2016-03-07 12:45:18 +01:00
Ngoc Tran
60f8062cfe Fixes #1220, https://github.com/tgriesser/knex/issues/1220, inTable(undefined) fails silently error by making sure it throws an error if the user passes an undefined table name. 2016-03-07 03:33:17 -08:00
wubzz
f85471b12a Merge pull request #1247 from caelon/patch-1
Update docs for returning to include multiple columns
2016-03-04 21:01:18 +01:00
Don VanDemark
f716990765 Update docs for returning to include multiple columns
Added a use case and an example for .returning
2016-03-04 14:50:37 -05:00
Sky Morey
3332c0bd35 Merge pull request #1246 from wubzz/add_mssql_query_examples
Add MSSQL query examples to docs
2016-03-04 13:23:10 -06:00
wubzz
aee76f5578 Add MSSQL query examples to docs 2016-03-04 19:00:12 +01:00
wubzz
3da10db968 Merge pull request #1241 from wubzz/feature/add_dropUnique_and_dropPrimary_to_docs
Add dropUnique and dropPrimary to docs.
2016-03-02 14:39:07 +01:00
wubzz
7b8f685d2e Add dropUnique and dropPrimary to docs. 2016-03-02 14:20:36 +01:00
Rhys van der Waerden
15686f639e Merge pull request #1142 from jurko-gospodnetic/returning-doc-update
Returning doc update
2016-03-02 19:18:11 +11:00
Simon
ae0fa44374 Merge pull request #1239 from wubzz/bugfix/mssql_configuration
Make connection.server = connection.host for MSSQL. Fixes #1235
2016-03-01 21:07:14 +01:00
blah238
3e6daa2f93 Merge pull request #943 from galenandrew/feature/docs-enu-values
Update to enum schema documentation
2016-03-01 13:06:22 -06:00
wubzz
f60ed93f0c Make connection.server = connection.host for MSSQL. Fixes #1235 2016-03-01 20:05:46 +01:00
blah238
a693e20b18 Merge pull request #1100 from IsaacLessard/master
2616: removed double words
2016-03-01 13:04:03 -06:00
blah238
3a2ceb38f1 Merge pull request #1222 from McFreely/patch-1
Fix small link bug
2016-03-01 13:02:49 -06:00
Rhys van der Waerden
69a61fbfb7 Merge pull request #1238 from danmactough/fix-process-exit-on-error-with-ok-error-code
Fix calling process.exit with "ok" exit code
2016-03-02 04:01:51 +11:00
Dan MacTough
72c934a2d1 Fix calling process.exit with "ok" exit code
We have a helper to log an error message to the console and exit the process. It looks like the only place we use this helper is when we try and fail to [initialize the driver](5a94bc9b17/src/client.js (L159)).

Unfortunately, when we call `process.exit()` without an exit code, it [exits with a `0` exit code](https://nodejs.org/api/process.html#process_process_exit_code) -- which means success.

This is especially a problem when running tests in a CI environment, as it results in a false positive: tests not only do not pass, but they probably didn't even run.
2016-03-01 11:36:59 -05:00
wubzz
93d018a817 Change assertion 2016-02-26 20:32:34 +01:00
wubzz
b6860b6b37 Add 'query-response to documentation, and add some assertions to the test. 2016-02-26 20:01:18 +01:00
wubzz
e4f36fad82 Fix indentation 2016-02-26 19:52:28 +01:00
wubzz
840d2d1299 Add 'query-response' event. Fixes #1203 2016-02-26 19:51:35 +01:00
Jurko Gospodnetić
f38f901bd5 clean up sibling nested transaction tracking code
- improved related comments
- renamed `trx._queue` to `trx._previousSibling`
- made code waiting for `trx._previousSibling`, instead of code initializing
  that promise, more explicit about waiting for the promise to be either
  resolved or rejected, i.e. `settled`/`completed`
- made the code a bit more compact
2016-02-25 12:32:09 +01:00
Jurko Gospodnetić
e0e77dfaf8 simplify nested transaction - no need to track _childQueue
The only thing each transaction needs to track is its last direct child
transaction. That is then used to prevent each sibling transaction from
starting (i.e. returning its connection) before its predecessor
transaction completed.
2016-02-25 12:32:09 +01:00
Jurko Gospodnetić
4a0b49fece simplify nested transaction _.queue variable initialization
- removed an unnecessary `||` with an always `undefined` value
- avoided waiting for an always resolved promise
2016-02-25 12:32:09 +01:00
Jurko Gospodnetić
675c684d3b test sibling nested transactions 2016-02-25 12:32:09 +01:00
Jurko Gospodnetić
d0836b8f88 fix synchronizing sibling nested transactions
Before, if we had parent transaction A, and two nested sibling transactions
inside it: B1 & B2, knex would hang when you asked it to execute any kind of
a database operation in the second child transaction.

Also, it had a bad Promise.settle() call that would break in case the
previous child transaction promise not resolve to an array, which typically
(e.g. when calling trx.commit() on the passed transaction object or
resolving the transaction promise with no value) it would not.
2016-02-24 12:32:48 +01:00
Jurko Gospodnetić
13ba707201 update returning() docs with more detailed parameter info 2016-02-24 12:04:04 +01:00
Jurko Gospodnetić
f6ae02896c fix utilitzed --> utilized doc typo 2016-02-24 12:04:04 +01:00