34 Commits

Author SHA1 Message Date
Bo Lingen
2463e077e8 Fix comments that were modified by find & replace (#3308)
The find & replace of ES module import syntax to cjs `require`s in #3227 modified some comments.
2019-06-26 08:31:23 +02:00
Cemre Mengu
6e5e296ede ORACLEDB: Updated handling of connection errors for disposal (#2608) 2019-06-19 21:26:28 +02:00
Igor Savin
1e950b93e4
Name Bluebird usage explicitly. Remove spread and thenReturn (#3285) 2019-06-17 02:14:17 +02:00
Igor Savin
c431ffc35a
Drop support for Node.js 6. Remove babel. (#3227) 2019-06-04 00:37:17 +02:00
Igor Savin
b9a648c6c4
Format code (#3088) 2019-03-05 18:46:58 +01:00
Tim Griesser
232fe9f151
Add Prettier (#2697)
* Add prettier
* Run files through prettier
2018-07-09 08:10:34 -04:00
Facundo Matteo
ec8550249f Make the stream catch errors in the query (#2638)
* Make the stream catch errors in the query

* Fix another case in which stream doesnt emits error

* Linter stuff

* Remove setTimeout in tests

* Make a test not to check the MySQL error code

* Fix stream error catching for MariaDB and PostgreSQL

* Fix stream error catching in Oracle

* Throw the error after emitting it to the stream

* Throw the error without instantiating a new Error
2018-06-27 22:42:50 +03:00
Simon Lidén
cf51f5c429 Removal of 'skim' (#2520) 2018-05-29 10:14:35 -04:00
Joel Mukuthu
bf1fa63118 Add queryContext to schema and query builders (#2314)
* feat(query-builder): add hookContext for wrapIdentifier

* refactor: use isUndefined

* test(transaction): test passing of hookContext

* feat(runnner): pass context to postProcessResponse

* test(runner): test postProcessResponse for raw responses

* test(raw): test passing of hookContext

* feat: add hookContext to Raw and SchemaBuilder

* test(transaction): fix test for hookContext

* chore: fix lint error

* fix: check for hookContext before calling it

* test(transaction): fix hookContext test

* chore: remove whitespace

* test(hookContext): test cloning of context object

* refactor: hookContext -> queryContext

* minor: use more descriptive variable name

i.e. refactor: `context` => `queryContext`

* fix: remove unnecessary checks for query builder

* fix(Raw): pass query builder to formatter

* fix(SchemaCompiler): pass schema builder to formatter

* refactor: add addQueryContext helper

* feat: add queryContext to TableBuilder and ColumnBuilder

* fix(TableCompiler): pass table builder to formatter

* fix(ColumnCompiler): pass column builder to formatter

* fix(pushQuery): fix passing builder to formatter

* test(Schema|Table|ColumnCompiler): test passing queryContext

* fix(SchemaCompiler): pass queryContext to TableCompiler

* fix(TableCompiler): pass queryContext to ColumnCompiler

* test: add queryContext tests for all schema dialects

* test(TableCompiler): test overwriting queryContext from SchemaCompiler

* test(Raw): test passing queryContext to wrapIdentifier

* tests: run all the tests
2018-02-02 00:41:01 +02:00
Mikael Lepistö
15639d03db Build native sql for a dialect without to string (#2237)
* Exposed also positionBinding method to client base class and refactored calls to em

* Added toSQL().toNative() getter which returns dialect specfic sql and bindings.

* Refactored toSQL method implementation
2017-09-27 13:12:40 +03:00
Jonathan Stewmon
9122cbf6df upgrade generic-pool to 3.1.7 (#2208)
* Upgrade generic-pool to v3.1.7 (Attempt)

* Remove callback from pool create function

* Fix ESLint

* Send whole poolConfig to generic-pool (for idleTimeoutMillis etc)

* fix compatibility issues with generic-pool v3
- restore Client.poolDefaults to allow dialect overrides
- connection validators should always resolve with a boolean
- rely on generic pool acquire timeouts to avoid unhandled rejections
- simplify promise usage, avoiding Promise constructor anti-pattern
- enable testOnBorrow in docker tests to evict broken connections
- enable docker tests on Darwin
- enable docker tests for mysql2 dialect

* validate timeout settings and to 60s

* simplify Client.destroy promise handling

* return destroyRawConnection promise from dialects
2017-09-06 22:51:29 +03: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
7069ce509e Revert to generic pool (#1665) 2016-09-13 18:12:23 -04:00
Tim Griesser
f5bad1ae54 Simplifying internal client structure 2016-09-13 08:15:58 -04:00
Tim Griesser
53c5984a3b Simplify transaction classes 2016-09-12 18:45:35 -04:00
Tim Griesser
30342c32ae Simplify formatter use 2016-09-12 18:27:30 -04: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
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
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
Jacob Hoschar
eeae6c4e9f Fix invalid SQL in Oracle dialect ping function 2016-06-10 17:35:35 -04:00
Rhys van der Waerden
2acd6e5daa Make spaces in import braces consistent
`import {module}` -> `import { module }`
2016-05-18 20:22:50 +10:00
Rhys van der Waerden
06e3447440 Remove duplicate spaces in assignments.
These were previously horizontally aligned. The esnext conversion disrupted them all.
2016-05-18 19:59:24 +10:00
Rhys van der Waerden
3846b7182c Make codebase conform to ESLint rules
Just a couple of changes.
2016-05-17 01:01:34 +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
wubzz
fa125712da A default ping fn in default pool settings, and silently ignore errors when querying 'ROLLBACK' on a dead connection by using Promise.Timeout. 2016-04-02 16:35:27 +02:00
wubzz
f286da2796 Preserve original bindings at all times. Move prepBindings calls to toSQL() instead. Enforce 'bindings' to always be present in .toSQL() resultset. 2016-03-15 21:47:59 +01:00
wubzz
f37824a11e Fix indentation? 2016-03-15 18:12:36 +01:00
wubzz
1d27fb8550 Update lodash from 3.7.0 -> 4.6.0 2016-03-15 18:11:13 +01:00
Brian Black
25ffe0d84c dialects default to inherited SqlString 2015-11-29 18:54:05 -05:00
Brian Black
c6230568cd SqlString is now per-dialect 2015-11-29 18:44:12 -05:00
Mikael Lepistö
0c74f786a5 Optionally use DEFAULT instead of NULL when translating undefined to SQL value. 2015-11-14 19:46:34 +02:00
Helios
f4e8f60b53 fixed connection error handling for oracle dialect 2015-07-23 11:16:39 +03: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