Skip to content

10.14.1

Compare
Choose a tag to compare
@vitaly-t vitaly-t released this 16 Nov 00:32
· 133 commits to master since this release

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