All Versions
110
Latest Version
Avg Release Cycle
19 days
Latest Release
-
Changelog History
Page 5
Changelog History
Page 5
-
v7.2.0 Changes
- ๐ Pinned pg-pool and pg-types to a tighter semver range. This is likely not a noticeable change for you unless you were specifically installing older versions of those libraries for some reason, but making it a minor bump here just in case it could cause any confusion.
-
v7.0.0 Changes
๐ฅ Breaking Changes
- โฌ๏ธ Drop support for node <
4.x
. - โ Remove
pg.connect
pg.end
andpg.cancel
singleton methods. Client#connect(callback)
now returnsundefined
. It used to return an event emitter.- โฌ๏ธ Upgrade pg-pool to
2.x
. - โฌ๏ธ Upgrade pg-native to
2.x
. - Standardize error message fields between JS and native driver. The only breaking changes were in the native driver as its field names were brought into alignment with the existing JS driver field names.
- Result from multi-statement text queries such as
SELECT 1; SELECT 2;
are now returned as an array of results instead of a single result with 1 array containing rows from both queries.
โฌ๏ธ Please see here for a migration guide
โจ Enhancements
- ๐ Overhauled documentation: https://node-postgres.com.
- Add
Client#connect() => Promise<void>
andClient#end() => Promise<void>
calls. Promises are now returned from all async methods on clients if and only if no callback was supplied to the method. - โ Add
connectionTimeoutMillis
to pg-pool.
- โฌ๏ธ Drop support for node <
-
v6.2.0 Changes
- โ Add support for parsing
replicationStart
messages.
- โ Add support for parsing
-
v6.1.0 Changes
- โ Add optional callback parameter to the pure JavaScript
client.end
method. The native client already supported this.
- โ Add optional callback parameter to the pure JavaScript
-
v6.0.0 Changes
๐ฅ Breaking Changes
- Remove
pg.pools
. There is still a reference kept to the pools created & tracked bypg.connect
but it has been renamed, is considered private, and should not be used. Accessing this API directly was uncommon and was supposed to be private but was incorrectly documented on the wiki. Therefore, it is a breaking change of an (unintentionally) public interface to remove it by renaming it & making it private. Eventuallypg.connect
itself will be deprecated in favor of instantiating pools directly vianew pg.Pool()
so this property should become completely moot at some point. In the mean time...check out the new features...
๐ New features
- ๐ Replace internal pooling code with pg-pool. This is the first step in eventually deprecating and removing the singleton
pg.connect
. The pg-pool constructor is exported from node-postgres atrequire('pg').Pool
. It provides a backwards compatible interface withpg.connect
as well as a promise based interface & additional niceties.
You can now create an instance of a pool and don't have to rely on the
pg
singleton for anything:var pg = require('pg') var pool = new pg.Pool() // your friendly neighborhood pool interface, without the singleton pool.connect(function(err, client, done) { // ... })
๐ Promise support & other goodness lives now in pg-pool.
Please read the readme at pg-pool for the full api.
- ๐ Included support for tcp keep alive. Enable it as follows:
var client = new Client({ keepAlive: true });
This should help with backends incorrectly considering idle clients to be dead and prematurely disconnecting them.
- Remove
-
v5.1.0 Changes
- ๐ Make the query object returned from
client.query
implement the promise interface. This is the first step towards promisifying more of the node-postgres api.
Example:
var client = new Client(); client.connect(); client.query("SELECT $1::text as name", ["brianc"]).then(function(res) { console.log("hello from", res.rows[0]); client.end(); });
- ๐ Make the query object returned from
-
v5.0.0 Changes
๐ฅ Breaking Changes
- ๐ป
require('pg').native
now returns null if the native bindings cannot be found; previously, this threw an exception.
๐ New Features
- ๐ better error message when passing
undefined
as a query parameter - ๐ support for
defaults.connectionString
- ๐ support for
returnToHead
being passed to generic pool
- ๐ป
-
v4.5.0 Changes
- โ Add option to parse JS date objects in query parameters as UTC
-
v4.4.0 Changes
- ๐ Warn to
stderr
if a named query exceeds 63 characters which is the max length supported by postgres.
- ๐ Warn to