- Removes support for Node.js domains, which no longer exist.
- URI encodes all connection string bits so that special characters won't break connections.
- BUG: Fix support for exploding multiple largish arrays into a query.
- Adds support for closing all of the connections for a pooled instance.
- Adds support for closing all of the connections of all instances.
- Exposes the pg module on each instance as
pg on the main export and instance.pg for each instance;
- BUG: Fixes handling of empty arrays for both set and literal treatment. If an empty array is passed in a non-literal context, it will be turned into
(select 1 from false), since PostgreSQL has no empty set literal (that I know of, corrections welcome). If the array is literal, it will end up as ARRAY[]. In both cases, the parameter will be spliced from the params array and any further numbered parameter references will be shifted down.
- BUG: Fixes options getting set from last param in certain situations during normalization.
- Adds support for
apply-like calls during query normalization, meaning you can now pass all of your parameters in a single array. This allows convenient query building using an array to build up the statement and params as you check for options e.g.
let q = ['select * from table'], join = ' where ';
if (someOption) {
q[0] += `${join}foo = ?`;
q.push(someOption);
join = ' and ';
}
if (otherOption) {
q[0] += `${join}bar = ?`;
q.push(otherOption);
join = ' and ';
}
db.query(q);
- BUG: Fix nesting a transaction within a transaction so that the outer transaction is used.
- Adds support for ssl as a connection param.
- Adds failed query info to exceptions.
- BUG: Fix setup of transaction objects so that they don't get their query methods overwritten with the generic db methods.
- Add support for disabling domain.
- Adds support for using query methods as template tags.
- BUG?: Use the transaction connection, if available, when querying. This mostly kicks in when domains fall over.
- Adds support for substituting array parameters for an array constructor (
ARRRAY[]) if there is a flag set on the array (literalArray)
- Adds support for javascript arrays in queries by splitting them out in to sql arrays in the query and adjusting the params array to include the members of the parameter.
- BUG: Fixes normalization of queries with ? params not referencing any params beyond the first.
- BUG: Fixes normalization of queries without parameters not carrying over their options if supplied.
- BUG: Fixes null bug related to hasCurrent and currentVal for domain transactions.
- BUG: different database/server/user combos can now be handled concurrently after rewriting to use stacked prototypes where possible
- Expands the test suite to verify common transactional handling cases
- Drops the hard dependency on when and switches to ES6 promises
- BUG: fixes error on passing pre-normalized query though normalize again.
- Adds support for ? parameters in addition to $# and $name parameters.
- Positional parameters may be passed as varargs or an array.
- An optional options object may be passed as the last argument to a query method.
- Expands the test suite to cover various methods of parameter handling.
- Exposes the connection string on for the db.
- BUG: fixes an issue with nested transactions not nesting correctly.
- Adds an initial test suite.
- Adds support for stack-based transactions using domains. Any database interaction that takes place within and existing transaction block somewhere up the stack will use the existing transaction unless otherwise specified explicitly using db.newTransaction.
- Adds support for named parameters.
- Queries return promises, which can be used inside a transactional generator.
- Supports a plain query for a result set object, queryOne for an expected single result, and nonQuery for rowCount-only queries.