2393 Commits

Author SHA1 Message Date
Brian M. Carlson
111e08d0d7 Cleanup 2017-07-16 16:25:35 -05:00
Brian M. Carlson
ac3102eea2 Add support for pg-native multi-row result 2017-07-16 16:25:35 -05:00
Brian M. Carlson
28b330c88e Add JS driver support for multiple results 2017-07-16 16:25:35 -05:00
Brian C
8798e50ad3 Re-enable eslint with standard format (#1367)
* Work on converting lib to standard

* Finish updating lib

* Finish linting lib

* Format test files

* Add .eslintrc with standard format

* Supply full path to eslint bin

* Move lint command to package.json

* Add eslint as dev dependency
2017-07-15 12:05:58 -05:00
Brian M. Carlson
f7de9ce820 Non-array query values cause query to end with an error.
This is a small change and is _kinda_ backwards compatible since the old behavior was to throw an error, but if someone was relying on anything with `.map` working as values it would break them, so it's in a major semver bump.
2017-07-15 11:19:37 -05:00
Brian Carlson
27450d07e6 Throw on reconnect attempt
Clients are not reusable.  This changes the client to raise errors whenever you try to reconnect a client that's already been used.  They're cheap to create: just instantiate a new one (or use the pool) 😉.

Closes #1352
2017-07-15 11:02:09 -05:00
Brian Carlson
a446537377 Bump version 2017-07-14 14:07:19 -05:00
Brian C
40f5126b6e Fix idle client teardown on error (#68)
- Re-add default idleTimeoutMillis = 10000 by default
- Fix idle timeout clearing on shutdown
- Ensure idleTimeoutMillis is used in timeout
2017-07-14 14:07:07 -05:00
Brian C
2421a769cb Update README.md 2017-07-13 22:40:26 -05:00
Brian Carlson
139cbdea16 Bump version 2017-07-13 22:37:45 -05:00
Brian C
a0eb36d819 2.0 (#67)
* Initial work

* Make progress on custom pool

* Make all original tests pass

* Fix test race

* Fix test when DNS is missing

* Test more error conditions

* Add test for byop

* Add BYOP tests for errors

* Add test for idle client error expunging

* Fix typo

* Replace var with const/let

* Remove var usage

* Fix linting

* Work on connection timeout

* Work on error condition tests

* Remove logging

* Add connection timeout

* Add idle timeout

* Test for returning to client to pool after error

fixes #48

* Add idleTimeout support to native client

* Add pg as peer dependency

fixes #45

* Rename properties

* Fix lint

* use strict

* Add draining to pool.end

* Ensure ending pools drain properly

* Remove yarn.lock

* Remove object-assign

* Remove node 8

* Remove closure for waiter construction

* Ensure client.connect is never sync

* Fix lint

* Change to es6 class

* Code cleanup & lint fixes
2017-07-13 22:37:08 -05:00
Brian Carlson
bc0b03e0b0 Bump version v6.4.1 2017-07-13 22:29:42 -05:00
2Pacalypse-
e52512cedb Adjust the test for arrays of buffers to work across all node versions. 2017-07-13 22:24:52 -05:00
2Pacalypse-
e44d83f02f Add the test for arrays of buffers. 2017-07-13 22:24:52 -05:00
2Pacalypse-
c2af53a24e Properly insert buffers in arrays.
Before this commit, when someone tried to insert a Buffer into an array,
the library would try to escape it (by calling the `escapeElement` on
it), which would fail because buffers don't have a `replace` method.
2017-07-13 22:24:52 -05:00
Luis Montes
45d82320b7 Merge pull request #10 from NoNameProvided/patch-1
Add support for Typescript typings

thanks @NoNameProvided  !
2017-06-27 10:09:14 -07:00
Luis Montes
e6643e4cb4 Merge pull request #7 from motiz88/extra-keys
Copy all but special-cased params from URL query string to config
2017-06-27 09:56:42 -07:00
Karl Böhlmark
dbf3bd3304 use consistent syntax for semver ranges 2017-06-26 15:11:53 -04:00
Brian M. Carlson
a0a050702e Bump version v6.4.0 2017-06-21 12:33:43 -05:00
Brian M. Carlson
7636f3630b Update changelog 2017-06-21 12:33:33 -05:00
Brian M. Carlson
055e708dc6 Bump version v6.3.2 2017-06-21 12:29:57 -05:00
Eder Ávila Prado
860cccd531 fix for server enconding when using SQL_ASCII and latin1 enconding 2017-06-21 12:23:06 -05:00
Brian Carlson
afe249896f Bump version v6.3.1 2017-06-20 09:30:59 -05:00
Brian Carlson
e4469340ae Fix deprecation warnings in native driver 2017-06-20 09:28:44 -05:00
Brian C
842803c7ef Fix over-eager deprecation warnings (#1333)
* WIP

* Remove console.log messages
2017-06-20 08:59:07 -05:00
Brian M. Carlson
f7a946155f Bump version v6.3.0 2017-06-19 16:08:23 -05:00
Brian M. Carlson
1e04fdb7e0 Add changes for v6.3.0 2017-06-19 16:07:12 -05:00
Brian M. Carlson
b5b49eb895 Add deprecations
This adds deprecations in preparation for `pg@7.0`

- deprecate using event emitters on automatically created results from client.query.
- deprecate query.promise() - it should never have been a public method and it's not documented. I need to do better about using _ prefix on private methods in the future.
- deprecate singleton pool on the `pg` object. `pg.connect`, `pg.end`, and `pg.cancel`.
2017-06-19 16:00:37 -05:00
Brian M. Carlson
a83655a396 Remove console.log statement 2017-06-18 17:23:58 -05:00
Brian M. Carlson
da71ea58f6 Add query validity check
Passing nothing for both the query.text and query.name is unsupported but previously crashed with an impossible to catch error.
2017-06-18 17:15:46 -05:00
Brian M. Carlson
bd87cddc72 Fix connection / disconnection issues 2017-06-18 16:48:14 -05:00
Brian M. Carlson
729d4e9c47 Tweak travis.yml 2017-06-18 16:48:14 -05:00
Brian M. Carlson
0f1f8626cf Add use strict to every file 2017-06-18 16:48:14 -05:00
Brian M. Carlson
49c5976947 Tweak travis node versions 2017-06-18 16:48:14 -05:00
Brian M. Carlson
ed9a33d3d1 Fix test for older version of postgres 2017-06-18 16:48:14 -05:00
Brian M. Carlson
2300445646 Cleanup a bit of dead code 2017-06-18 16:48:14 -05:00
Brian M. Carlson
1bc1758579 Remove deprecated methods 2017-06-18 16:48:14 -05:00
Brian M. Carlson
313c41a39f Cleanup 2017-06-18 16:48:14 -05:00
Brian M. Carlson
94a628a16f Update engine support 2017-06-18 15:34:44 -05:00
Brian M. Carlson
0c32c57e0e Bump version 2017-06-18 14:09:54 -05:00
Brian C
f7b1edc7bb Add client to error event emitter (#65)
When the pool emits an error pass the client as the 2nd parameter to the `on('error')` handler.
2017-06-18 14:09:18 -05:00
Brian Carlson
63b23bc93a Merge branch 'master' into 7.0 2017-06-16 21:44:24 -05:00
Brian M. Carlson
cfd9caa925 Deprecate query.on & query.once 2017-06-16 21:43:45 -05:00
Brian M. Carlson
76c1000567 Add event-emitters back 2017-06-16 21:43:45 -05:00
Brian M. Carlson
0ce8a6c675 Fix brittle unit tests 2017-06-16 21:43:45 -05:00
Brian Carlson
5f5e40f03c Add tests to support deprecated event listeners 2017-06-16 21:43:45 -05:00
Brian Carlson
fc3634045b Move attach listeners into its own function
Just for readability
2017-06-16 21:43:45 -05:00
Brian M. Carlson
a4b42ac36b Add co to dev deps 2017-06-15 10:32:38 -05:00
Brian M. Carlson
e100152fb0 Remove failing travis test 2017-06-15 10:32:38 -05:00
Brian M. Carlson
132861f43f Test cleanup 2017-06-15 10:32:38 -05:00