@pgpmjs/types 2.55.2 → 2.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/pgpm.d.ts +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/types",
3
- "version": "2.55.2",
3
+ "version": "2.56.1",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM types",
6
6
  "main": "index.js",
@@ -29,7 +29,7 @@
29
29
  "test:watch": "jest --watch"
30
30
  },
31
31
  "dependencies": {
32
- "@constructive-io/errors": "^0.20.0",
32
+ "@constructive-io/errors": "^0.21.0",
33
33
  "pg-env": "^1.32.0"
34
34
  },
35
35
  "keywords": [
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "makage": "^0.8.0"
45
45
  },
46
- "gitHead": "e05686fb94c5e22c954436f18c25aa4439b9e83e"
46
+ "gitHead": "34e91da5b3dd9c0cae14875afe609993acf53a84"
47
47
  }
package/pgpm.d.ts CHANGED
@@ -12,10 +12,25 @@ export interface AuthOptions {
12
12
  /** Key name for user ID in session context (defaults to 'jwt.claims.user_id') */
13
13
  userIdKey?: string;
14
14
  }
15
+ /**
16
+ * How DEFERRABLE INITIALLY DEFERRED constraints are treated inside a test transaction.
17
+ *
18
+ * Test isolation rolls every test back instead of committing, so constraints that
19
+ * Postgres only checks at COMMIT would otherwise never fire.
20
+ *
21
+ * - `'off'` leave them deferred and never checked (default)
22
+ * - `'check'` run the commit-time checks at the end of each test, right before the
23
+ * rollback (`SET CONSTRAINTS ALL IMMEDIATE`); deferral still works inside the test
24
+ * - `'immediate'` `SET CONSTRAINTS ALL IMMEDIATE` at the start of each test so violations
25
+ * fail on the offending statement; disables deferral the code under test may rely on
26
+ */
27
+ export type DeferredConstraintsMode = 'off' | 'check' | 'immediate';
15
28
  /**
16
29
  * Configuration options for PostgreSQL test database connections
17
30
  */
18
31
  export interface PgTestConnectionOptions {
32
+ /** How deferred constraints are handled under rollback-based test isolation (default: 'off') */
33
+ deferredConstraints?: DeferredConstraintsMode;
19
34
  /** The root database to connect to for creating test databases */
20
35
  rootDb?: string;
21
36
  /** Template database to use when creating test databases */