2393 Commits

Author SHA1 Message Date
Brian M. Carlson
cf28f9357f Bump version 2016-08-26 09:11:18 -05:00
jphaas
b091cc0d05 Bug fix: Pool.query now calls cb if connect() fails (#25)
* Pool.query calls cb if connect() fails

Old behavior was that if connect called back with an error, the promise would get rejected but the cb function would never get called.

* Test that Pool.query passes connection errors to callback

* Fixes to standardjs compliance
2016-08-26 09:08:15 -05:00
Brian M. Carlson
f2221a4040 Bump version 2016-08-26 09:07:54 -05:00
Brian M. Carlson
afce7ed6e3 Bump version 2016-08-26 09:05:46 -05:00
Vitaly Tomilov
ec941c45c1 Upgrading tests to PostgreSQL 9.5 (#1114)
Setting PostgreSQL 9.5 as the main version to test against.

NOTE: The following settings are required for 9.5 to work:
```
sudo: required
dist: trusty
```
2016-08-22 22:35:41 -05:00
brianc
42689dac11 Bump version v6.1.0 2016-08-11 10:18:19 -05:00
brianc
4251a09b0b Update changelog 2016-08-11 10:18:12 -05:00
Brian C
a536afb1a8 Add callback to client#end (#1106)
A long standing bug was the pure JS client didn't accept or call a callback on `client.end`.  This is inconsistent with both the documentation & general node patterns.

This fixes the issue & adds a test.  The issue did not exist in the native version of the client.
2016-08-11 10:17:03 -05:00
brianc
a95d9ac711 Bump version v6.0.4 2016-08-10 15:15:43 -05:00
hoegaarden
f857bbf623 pgpass: Upgrade to 1.x (#1098)
pgpass is using semver versioning now, thus a dependency on
version 1.x should be safe.
2016-08-10 15:15:09 -05:00
brianc
9964208fe8 Bump version 2016-08-05 16:23:05 -05:00
Cody Greene
eca2ea0ede emit "connect" event only on success and avoid double callback (#22)
* fail: "connect" event only on success

Double callback invocation will also cause this to fail.

* avoid double callback: _create

If `client.connect` returns an error, then the callback for `Pool#_create` is only invoked once. Also the `connect` event is only emitted on a successful connection, the client is otherwise rather useless.

* legacy compat; don't use Object.assign

* legacy compat; events.EventEmitter
2016-08-05 16:22:50 -05:00
Cody Greene
51fb7db8fa Support function-like construction (plus test) (#23)
* Support function-like construction

Remove the necessity of using `new` in front of the `Pool`, i.e. allow it to be used as a regular function. This is following https://github.com/brianc/node-postgres/issues/1077

* add Pool factory test
2016-08-05 16:21:51 -05:00
Arnaud Benhamdine
9f955c4348 Add details about differences between js and native bindings (#1096) 2016-08-02 09:21:31 -05:00
Vince Coppola
4e77464bfc Small spelling fix (#1099) 2016-08-01 09:24:54 -05:00
Risto Novik
1d89029ba7 Added missing new keyword to Heroku example. (#21) 2016-07-26 10:18:14 -05:00
Arnaud Benhamdine
74db8f9cd2 Add badges for npm version and number of dl on npm (#1094) 2016-07-26 09:32:12 -05:00
brianc
9274f08fa2 Bump version v6.0.3 2016-07-19 10:18:56 -05:00
brianc
892d02ca1c Fix typo 2016-07-19 10:17:40 -05:00
Brian C
b1b2801c71 Add onFailure to query#then (#1082)
The promise adapter I had implemented wasn't spec compliant: it didn't accept both `onSuccess` and `onFailure` in the call to `query#then`.  This subtly broke yield & async/await because they both rely on `onError` being passed into `Promise#then`.  The pool was also not returning the promise after a client was acquired, which broke awaiting on `pool.connect` - this is also fixed now.
2016-07-19 10:16:48 -05:00
Timothy Haley
e2d77719e7 Url parsing example (#19)
* Added URL parsing example

* Typos and cleanup

* Last typo
2016-07-18 15:54:57 -05:00
Brian C
1dc1dbc5b6 Update README.md
Move SSL connection information to wiki
2016-07-10 16:29:42 -05:00
brianc
bd7fc59635 Bump version v6.0.2 2016-07-10 16:29:04 -05:00
guoxiangyang
33a1c35ad2 changed for self signed ssl support (#1072) 2016-07-10 16:26:36 -05:00
brianc
8c42c4172b Bump version 2016-07-03 16:17:55 -07:00
Brian C
9ab7aff029 Update code to run on >=0.10.0 (#17)
* Replace const with var

* Update code to run on 0.10.x +

* Lint
2016-07-03 18:17:34 -05:00
Brian C
ef1b15e13a Update README.md
Add note on "bring your own promise"
2016-06-30 15:22:49 -07:00
brianc
4f6208521b Bump version 2016-06-28 17:44:02 -07:00
Brian C
02dc31f925 Merge pull request #17 from rickbergfalk/master
handle empty query
2016-06-28 17:42:44 -07:00
Rick Bergfalk
74b6891b20 handle empty query 2016-06-28 16:47:50 -05:00
brianc
22a76ddd1d Bump version 2016-06-26 22:05:46 -07:00
brianc
d1c70ec9c1 Update documentation 2016-06-26 22:02:49 -07:00
Brian C
d653234a0c Add acquire event (#16)
* Add acquire event

Add acquire event which fires every time a client is acquired from the pool.

* Update README.md
2016-06-26 22:00:16 -07:00
Peter W
ce173f8c28 Fix error event doc in README (#15)
- making error event example code start by acquiring `pool` in
  the same way it is done in the example at the top for `create`
2016-06-26 21:39:36 -07:00
Peter W
d316ef5524 Fix example code for connect event (#14) 2016-06-25 11:21:40 -07:00
brianc
baa5800a70 Bump version 2016-06-24 09:53:46 -07:00
Brian C
aa1f10b0c0 Add support for pool#query without params (#12) 2016-06-24 11:52:32 -05:00
brianc
2d446d4953 Bump version 2016-06-24 11:36:36 -05:00
brianc
f47bc5f23b Update documentation 2016-06-24 11:35:33 -05:00
Brian C
ce59164ba1 Add callback interface to pool#query (#11)
* Add callback interface to pool#query

* Fix linting errors
2016-06-24 11:35:16 -05:00
Illirik Smirnov
522d62229b Resolve merge conflict in PR #1041 (#1065)
* Add license comment

* Delete pool.js
2016-06-24 10:56:43 -05:00
Brian C
8b45ea1e7d Update README.md
Add a section with instructions on where to instantiate your pool
2016-06-24 10:48:23 -05:00
brianc
c35adf6f68 Bump version v6.0.1 2016-06-24 01:23:19 -05:00
Brian C
1183658ceb Update README.md 2016-06-24 01:22:25 -05:00
Brian C
1bc50f186f Update README.md 2016-06-24 01:09:51 -05:00
Brian C
812277f99f Fix native constructor and pool exports (#1061) 2016-06-24 00:52:28 -05:00
Neil W
e2830ac847 Update README.md (#1063)
Fixed minor typo "exampe" -> "example"
2016-06-24 00:35:14 -05:00
brianc
4758ea660e Update documentation 2016-06-23 14:34:41 -05:00
Brian C
cc40403de9 Update README.md 2016-06-23 00:22:07 -05:00
brianc
955d6ba797 Bump version 2016-06-23 00:21:16 -05:00