pgsql-test 2.11.6 → 2.11.7
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/connect.d.ts +1 -1
- package/connect.js +6 -2
- package/esm/connect.js +6 -2
- package/package.json +2 -2
package/connect.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { DbAdmin } from './admin';
|
|
|
4
4
|
import { PgTestConnector } from './manager';
|
|
5
5
|
import { SeedAdapter } from './seed/types';
|
|
6
6
|
import { PgTestClient } from './test-client';
|
|
7
|
-
export declare const getPgRootAdmin: (connOpts?: PgTestConnectionOptions) => DbAdmin;
|
|
7
|
+
export declare const getPgRootAdmin: (config: PgConfig, connOpts?: PgTestConnectionOptions) => DbAdmin;
|
|
8
8
|
export interface GetConnectionOpts {
|
|
9
9
|
pg?: Partial<PgConfig>;
|
|
10
10
|
db?: Partial<PgTestConnectionOptions>;
|
package/connect.js
CHANGED
|
@@ -10,8 +10,12 @@ const manager_1 = require("./manager");
|
|
|
10
10
|
const roles_1 = require("./roles");
|
|
11
11
|
const seed_1 = require("./seed");
|
|
12
12
|
let manager;
|
|
13
|
-
const getPgRootAdmin = (connOpts = {}) => {
|
|
13
|
+
const getPgRootAdmin = (config, connOpts = {}) => {
|
|
14
14
|
const opts = (0, pg_env_1.getPgEnvOptions)({
|
|
15
|
+
user: config.user,
|
|
16
|
+
password: config.password,
|
|
17
|
+
host: config.host,
|
|
18
|
+
port: config.port,
|
|
15
19
|
database: connOpts.rootDb
|
|
16
20
|
});
|
|
17
21
|
const admin = new admin_1.DbAdmin(opts, false, connOpts);
|
|
@@ -33,7 +37,7 @@ const getConnections = async (cn = {}, seedAdapters = [seed_1.seed.launchql()])
|
|
|
33
37
|
cn = getConnOopts(cn);
|
|
34
38
|
const config = cn.pg;
|
|
35
39
|
const connOpts = cn.db;
|
|
36
|
-
const root = (0, exports.getPgRootAdmin)(connOpts);
|
|
40
|
+
const root = (0, exports.getPgRootAdmin)(config, connOpts);
|
|
37
41
|
await root.createUserRole(connOpts.connection.user, connOpts.connection.password, connOpts.rootDb);
|
|
38
42
|
const admin = new admin_1.DbAdmin(config, false, connOpts);
|
|
39
43
|
if (process.env.TEST_DB) {
|
package/esm/connect.js
CHANGED
|
@@ -7,8 +7,12 @@ import { PgTestConnector } from './manager';
|
|
|
7
7
|
import { getDefaultRole } from './roles';
|
|
8
8
|
import { seed } from './seed';
|
|
9
9
|
let manager;
|
|
10
|
-
export const getPgRootAdmin = (connOpts = {}) => {
|
|
10
|
+
export const getPgRootAdmin = (config, connOpts = {}) => {
|
|
11
11
|
const opts = getPgEnvOptions({
|
|
12
|
+
user: config.user,
|
|
13
|
+
password: config.password,
|
|
14
|
+
host: config.host,
|
|
15
|
+
port: config.port,
|
|
12
16
|
database: connOpts.rootDb
|
|
13
17
|
});
|
|
14
18
|
const admin = new DbAdmin(opts, false, connOpts);
|
|
@@ -29,7 +33,7 @@ export const getConnections = async (cn = {}, seedAdapters = [seed.launchql()])
|
|
|
29
33
|
cn = getConnOopts(cn);
|
|
30
34
|
const config = cn.pg;
|
|
31
35
|
const connOpts = cn.db;
|
|
32
|
-
const root = getPgRootAdmin(connOpts);
|
|
36
|
+
const root = getPgRootAdmin(config, connOpts);
|
|
33
37
|
await root.createUserRole(connOpts.connection.user, connOpts.connection.password, connOpts.rootDb);
|
|
34
38
|
const admin = new DbAdmin(config, false, connOpts);
|
|
35
39
|
if (process.env.TEST_DB) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgsql-test",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.7",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "pgsql-test offers isolated, role-aware, and rollback-friendly PostgreSQL environments for integration tests — giving developers realistic test coverage without external state pollution",
|
|
6
6
|
"main": "index.js",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"pg-copy-streams": "^6.0.6",
|
|
70
70
|
"pg-env": "^1.1.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "c892d09bf29438baf0542d4f2e8f4048ad383bc2"
|
|
73
73
|
}
|