Skip to content

Releases: vitaly-t/pg-promise

11.0.1

30 Dec 19:04
Compare
Choose a tag to compare

Removed use of operator ??=, which was causing error under NodeJS version < 15.

11.0.0

29 Dec 23:16
Compare
Choose a tag to compare

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 option max now, for the pool size.
  • NodeJS v14 is now the required minimum

OTHER CHANGES

  • Documentation updates
  • DEV dependencies updated

10.15.4

27 Nov 11:53
Compare
Choose a tag to compare
  • Fixes #854 TypeScript declaration issue.

10.15.3

24 Nov 09:57
Compare
Choose a tag to compare

10.15.2

22 Nov 10:24
Compare
Choose a tag to compare
  • Fixing #853 (crash in NodeJS v12)

10.15.1

21 Nov 21:19
Compare
Choose a tag to compare
  • Event error now reports query + params even for regular query errors (see pr #852)

10.15.0

17 Nov 06:31
Compare
Choose a tag to compare
  • Minimum version of NodeJS required is now v12.0.0 (was v8.0.0 previously). See the check.

10.14.2

17 Nov 06:20
Compare
Choose a tag to compare
  • 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

16 Nov 00:32
Compare
Choose a tag to compare

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

15 Nov 05:24
Compare
Choose a tag to compare
  • 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);
}