25 Commits

Author SHA1 Message Date
Tjerk Santegoeds
5c0b193fec fix: escapeObject parameter order for Postgres dialect. (#2003)
* fix: escapeObject parameter order for Postgres dialect.

* test: escapeObject for Postgres dialect.
2017-04-12 13:57:27 +03:00
Mikael Lepistö
137e1fe987 Allow passing version of connected db in configuration file (#1993)
* # This is a combination of 3 commits.
# The first commit's message is:
Allow passing config.version variable to knex instead of parsing the DB version from string returned form DB server.

This makes it possible to connect custom databases which are compatible with an official database of certain version.

# The 2nd commit message will be skipped:

#	Update checkVersion
#
#	To use `const` instead of `let` to fix lint error

# The 3rd commit message will be skipped:

#	Revert "Update checkVersion"
#
#	This reverts commit 248907decb94f0df2f2b3b9fe114738fb48394fc.

* Allow passing config.version variable to knex instead of parsing the DB version from string returned form DB server.

This makes it possible to connect custom databases which are compatible with an official database of certain version.
2017-03-27 00:21:15 +03:00
Casey Foster
19ed460f8b Properly close PG query stream on error (#1935)
Without calling `close()`, the `queryStream` will continue to execute a
query meaning there was no way to halt a long running query due to an
unrecoverable downstream error. I ran into this issue while streaming
IDs from a very large table as part of an ETL process. An error would
occur downstream in the transformation or loading step and I needed to
cancel the long-running extract stream, but there was no way to do so
and I'd eventually run out of connections in the pool.

This commit also handles the case when the non-callback version of
stream API was used and an exception was thrown. The issue was that the
promise was not reachable and therefore there was no way to add a
rejection handler. This resulted in an unavoidable `Unhandled Promise
Rejection` error.
2017-02-24 11:55:13 -05:00
Tim Griesser
5890e4d4ea Fix #1733, #920, incorrect postgres array bindings 2016-10-12 00:43:30 -04:00
Tim Griesser
fa30dfb858 Fix #1710 2016-10-09 14:33:51 -04: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
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
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
3846b7182c Make codebase conform to ESLint rules
Just a couple of changes.
2016-05-17 01:01:34 +10: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
freshsun
b34d03c45e update index.js to work with aliyun rds
aliyun rds return a simplified version "PostgreSQL x.x.x", and function checkVersion failed to handle it
2016-03-24 22:17:02 +08: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
gmichael225
4b2c0efff1 SQL compliant escaping, removed dialect-specific escaping for now 2015-12-24 11:33:48 +11:00
Brian Black
51907eebb9 mv src/dialects/postgres/string.js src/dialects/postgres/query/string.js 2015-11-29 18:54:05 -05:00
Brian Black
cee729cad0 Properly escape single quotes in postgres 2015-11-29 18:44:12 -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
Mikael Lepistö
b9d9a99f80 Added \? escape sequence to postgres dialect to allow using ? operator. 2015-08-25 10:19:35 +03:00
Daniel Teixeira
70e4692638 add support to postgres search_path 2015-08-09 23:04:57 -03:00
Tim Griesser
6cef074236 Fix correct files for #851 2015-06-01 09:22:27 -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