All Versions
110
Latest Version
Avg Release Cycle
19 days
Latest Release
-

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 and pg.cancel singleton methods.
    • Client#connect(callback) now returns undefined. 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> and Client#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.
  • v6.1.0 Changes

    • โž• Add optional callback parameter to the pure JavaScript client.end method. The native client already supported this.
  • v6.0.0 Changes

    ๐Ÿ’ฅ Breaking Changes

    • Remove pg.pools. There is still a reference kept to the pools created & tracked by pg.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. Eventually pg.connect itself will be deprecated in favor of instantiating pools directly via new 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 at require('pg').Pool. It provides a backwards compatible interface with pg.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.

  • 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();
    });
    
  • 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.