@pgpmjs/types 2.12.5 → 2.12.6

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.
package/esm/pgpm.js CHANGED
@@ -8,18 +8,23 @@ export const pgpmDefaults = {
8
8
  prefix: 'db-',
9
9
  extensions: [],
10
10
  cwd: process.cwd(),
11
- connection: {
12
- user: 'app_user',
13
- password: 'app_password',
14
- // TODO: check if this is used vs. roles below...
15
- role: 'anonymous'
11
+ connections: {
12
+ app: {
13
+ user: 'app_user',
14
+ password: 'app_password'
15
+ },
16
+ admin: {
17
+ user: 'app_admin',
18
+ password: 'admin_password'
19
+ }
16
20
  },
17
21
  roles: {
18
22
  anonymous: 'anonymous',
19
23
  authenticated: 'authenticated',
20
24
  administrator: 'administrator',
21
25
  default: 'anonymous'
22
- }
26
+ },
27
+ useLocksForRoles: false
23
28
  },
24
29
  pg: {
25
30
  host: 'localhost',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/types",
3
- "version": "2.12.5",
3
+ "version": "2.12.6",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM types",
6
6
  "main": "index.js",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "makage": "^0.1.9"
44
44
  },
45
- "gitHead": "e45ec95404e48d0c0542da882a3baea0cd6de1c7"
45
+ "gitHead": "ac6c6b866ea6a578baf61208b22fcb12fdd46e5d"
46
46
  }
package/pgpm.d.ts CHANGED
@@ -25,12 +25,14 @@ export interface PgTestConnectionOptions {
25
25
  extensions?: string[];
26
26
  /** Current working directory for database operations */
27
27
  cwd?: string;
28
- /** Database connection credentials */
29
- connection?: DatabaseConnectionOptions;
28
+ /** Test user credentials for app and admin users */
29
+ connections?: TestUserCredentials;
30
30
  /** Role mapping configuration */
31
31
  roles?: RoleMapping;
32
32
  /** Default authentication options for db connections */
33
33
  auth?: AuthOptions;
34
+ /** Use advisory locks for role/user creation (for concurrency safety) */
35
+ useLocksForRoles?: boolean;
34
36
  }
35
37
  /**
36
38
  * PostgreSQL session context settings for test clients
@@ -70,6 +72,15 @@ export interface DatabaseConnectionOptions {
70
72
  /** Database role to assume */
71
73
  role?: string;
72
74
  }
75
+ /**
76
+ * Test user credentials for app and admin users
77
+ */
78
+ export interface TestUserCredentials {
79
+ /** App user credentials (for RLS simulation) */
80
+ app?: DatabaseConnectionOptions;
81
+ /** Admin user credentials (for test admin operations) */
82
+ admin?: DatabaseConnectionOptions;
83
+ }
73
84
  /**
74
85
  * HTTP server configuration
75
86
  */
package/pgpm.js CHANGED
@@ -12,18 +12,23 @@ exports.pgpmDefaults = {
12
12
  prefix: 'db-',
13
13
  extensions: [],
14
14
  cwd: process.cwd(),
15
- connection: {
16
- user: 'app_user',
17
- password: 'app_password',
18
- // TODO: check if this is used vs. roles below...
19
- role: 'anonymous'
15
+ connections: {
16
+ app: {
17
+ user: 'app_user',
18
+ password: 'app_password'
19
+ },
20
+ admin: {
21
+ user: 'app_admin',
22
+ password: 'admin_password'
23
+ }
20
24
  },
21
25
  roles: {
22
26
  anonymous: 'anonymous',
23
27
  authenticated: 'authenticated',
24
28
  administrator: 'administrator',
25
29
  default: 'anonymous'
26
- }
30
+ },
31
+ useLocksForRoles: false
27
32
  },
28
33
  pg: {
29
34
  host: 'localhost',