@gustavo-valsechi/node 1.0.35 → 1.0.37
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/dist/index.js +4 -3
- package/dist/index.mjs +4 -3
- package/dist/src/services/index.js +4 -3
- package/dist/src/services/index.mjs +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -321,16 +321,15 @@ var TenantService = class {
|
|
|
321
321
|
}
|
|
322
322
|
async getTenantQueryRunner() {
|
|
323
323
|
var _a;
|
|
324
|
-
if (this.runner) return this.runner;
|
|
325
324
|
const runner = this.db.createQueryRunner();
|
|
326
325
|
await runner.connect();
|
|
327
326
|
const result = await runner.query(`
|
|
328
327
|
SELECT EXISTS (
|
|
329
328
|
SELECT 1
|
|
330
329
|
FROM information_schema.schemata
|
|
331
|
-
WHERE schema_name =
|
|
330
|
+
WHERE schema_name = $1
|
|
332
331
|
) AS "exists"
|
|
333
|
-
|
|
332
|
+
`, [this.idTenant]);
|
|
334
333
|
await runner.query(`CREATE SCHEMA IF NOT EXISTS "${this.idTenant}"`);
|
|
335
334
|
await runner.query(`SET search_path TO "${this.idTenant}"`);
|
|
336
335
|
if (!((_a = result == null ? void 0 : result[0]) == null ? void 0 : _a.exists)) await runner.query(this.migrations);
|
|
@@ -349,6 +348,8 @@ var TenantService = class {
|
|
|
349
348
|
await this.getTenantQueryRunner();
|
|
350
349
|
await ((_a = this.runner) == null ? void 0 : _a.query("SET search_path TO public"));
|
|
351
350
|
await ((_b = this.runner) == null ? void 0 : _b.release());
|
|
351
|
+
this.runner = void 0;
|
|
352
|
+
this.repository = void 0;
|
|
352
353
|
}
|
|
353
354
|
};
|
|
354
355
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -290,16 +290,15 @@ var TenantService = class {
|
|
|
290
290
|
}
|
|
291
291
|
async getTenantQueryRunner() {
|
|
292
292
|
var _a;
|
|
293
|
-
if (this.runner) return this.runner;
|
|
294
293
|
const runner = this.db.createQueryRunner();
|
|
295
294
|
await runner.connect();
|
|
296
295
|
const result = await runner.query(`
|
|
297
296
|
SELECT EXISTS (
|
|
298
297
|
SELECT 1
|
|
299
298
|
FROM information_schema.schemata
|
|
300
|
-
WHERE schema_name =
|
|
299
|
+
WHERE schema_name = $1
|
|
301
300
|
) AS "exists"
|
|
302
|
-
|
|
301
|
+
`, [this.idTenant]);
|
|
303
302
|
await runner.query(`CREATE SCHEMA IF NOT EXISTS "${this.idTenant}"`);
|
|
304
303
|
await runner.query(`SET search_path TO "${this.idTenant}"`);
|
|
305
304
|
if (!((_a = result == null ? void 0 : result[0]) == null ? void 0 : _a.exists)) await runner.query(this.migrations);
|
|
@@ -318,6 +317,8 @@ var TenantService = class {
|
|
|
318
317
|
await this.getTenantQueryRunner();
|
|
319
318
|
await ((_a = this.runner) == null ? void 0 : _a.query("SET search_path TO public"));
|
|
320
319
|
await ((_b = this.runner) == null ? void 0 : _b.release());
|
|
320
|
+
this.runner = void 0;
|
|
321
|
+
this.repository = void 0;
|
|
321
322
|
}
|
|
322
323
|
};
|
|
323
324
|
export {
|
|
@@ -34,16 +34,15 @@ var TenantService = class {
|
|
|
34
34
|
}
|
|
35
35
|
async getTenantQueryRunner() {
|
|
36
36
|
var _a;
|
|
37
|
-
if (this.runner) return this.runner;
|
|
38
37
|
const runner = this.db.createQueryRunner();
|
|
39
38
|
await runner.connect();
|
|
40
39
|
const result = await runner.query(`
|
|
41
40
|
SELECT EXISTS (
|
|
42
41
|
SELECT 1
|
|
43
42
|
FROM information_schema.schemata
|
|
44
|
-
WHERE schema_name =
|
|
43
|
+
WHERE schema_name = $1
|
|
45
44
|
) AS "exists"
|
|
46
|
-
|
|
45
|
+
`, [this.idTenant]);
|
|
47
46
|
await runner.query(`CREATE SCHEMA IF NOT EXISTS "${this.idTenant}"`);
|
|
48
47
|
await runner.query(`SET search_path TO "${this.idTenant}"`);
|
|
49
48
|
if (!((_a = result == null ? void 0 : result[0]) == null ? void 0 : _a.exists)) await runner.query(this.migrations);
|
|
@@ -62,6 +61,8 @@ var TenantService = class {
|
|
|
62
61
|
await this.getTenantQueryRunner();
|
|
63
62
|
await ((_a = this.runner) == null ? void 0 : _a.query("SET search_path TO public"));
|
|
64
63
|
await ((_b = this.runner) == null ? void 0 : _b.release());
|
|
64
|
+
this.runner = void 0;
|
|
65
|
+
this.repository = void 0;
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -8,16 +8,15 @@ var TenantService = class {
|
|
|
8
8
|
}
|
|
9
9
|
async getTenantQueryRunner() {
|
|
10
10
|
var _a;
|
|
11
|
-
if (this.runner) return this.runner;
|
|
12
11
|
const runner = this.db.createQueryRunner();
|
|
13
12
|
await runner.connect();
|
|
14
13
|
const result = await runner.query(`
|
|
15
14
|
SELECT EXISTS (
|
|
16
15
|
SELECT 1
|
|
17
16
|
FROM information_schema.schemata
|
|
18
|
-
WHERE schema_name =
|
|
17
|
+
WHERE schema_name = $1
|
|
19
18
|
) AS "exists"
|
|
20
|
-
|
|
19
|
+
`, [this.idTenant]);
|
|
21
20
|
await runner.query(`CREATE SCHEMA IF NOT EXISTS "${this.idTenant}"`);
|
|
22
21
|
await runner.query(`SET search_path TO "${this.idTenant}"`);
|
|
23
22
|
if (!((_a = result == null ? void 0 : result[0]) == null ? void 0 : _a.exists)) await runner.query(this.migrations);
|
|
@@ -36,6 +35,8 @@ var TenantService = class {
|
|
|
36
35
|
await this.getTenantQueryRunner();
|
|
37
36
|
await ((_a = this.runner) == null ? void 0 : _a.query("SET search_path TO public"));
|
|
38
37
|
await ((_b = this.runner) == null ? void 0 : _b.release());
|
|
38
|
+
this.runner = void 0;
|
|
39
|
+
this.repository = void 0;
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
export {
|