Releases: vitaly-t/pg-promise
Releases · vitaly-t/pg-promise
11.0.1
11.0.0
BREAKING CHANGES
- Initialization option
noLocking
and all the locking logic has been removed. It was a bit of an over-engineering thing. - Parameters for events connect, disconnect and receive have changed (wrapped into an object)
- Connection option
poolSize
has been retired. You should just use optionmax
now, for the pool size. - NodeJS v14 is now the required minimum
OTHER CHANGES
- Documentation updates
- DEV dependencies updated
10.15.4
10.15.3
10.15.2
10.15.1
10.15.0
- Minimum version of NodeJS required is now v12.0.0 (was v8.0.0 previously). See the check.
10.14.2
- Assertions were refactored internally, so now they can be overridden via
global.pgPromiseAssert
. See assert-options module. - Improved
Buffer
detection - Documentation updates
10.14.1
Fixes for TypeScript declarations:
- Fixing declaration for method
result
- Fixing declaration for
txMode
namespace, so it is consistent with how the library works:
Example of correct txMode
usage:
import {txMode} from 'pg-promise';
const {isolationLevel, TransactionMode} = txMode;
const mode = new TransactionMode({tiLevel: isolationLevel.none});
Or, you still can extract those from both uninitialized library:
import * as pgPromise from 'pg-promise';
const {isolationLevel, TransactionMode} = pgPromise.txMode; // from uninitialized library
... and from initialized library instance:
import * as pgPromise from 'pg-promise';
const pgp = pgPromise({/* init options */}); // initializing the library
const {isolationLevel, TransactionMode} = pgp.txMode; // from initialized library
10.14.0
- Type
Result
(returned from methods result and multiResult) is now iterable, automatically exposing rows of data:
const res = await db.result('select * from users');
for (const r of res) {
console.log(r); // print each row
}
Above, res
(of type Result
) is now iterable, automatically exposing res.rows.values()
.
To that end, the typescript declarations have been updated accordingly.
TypeScript example
class User {
id: number;
login: string;
active: boolean;
}
// example of typed query result
const res = await db.result<IResultExt<User>>('select * from users');
for (const r of res) {
// r here is strongly-typed
console.log(r);
}