@diia-inhouse/db 12.5.8 → 12.5.10
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.
|
@@ -3,9 +3,7 @@ import { getTableConfig } from "drizzle-orm/pg-core";
|
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
6
|
-
import { register } from "tsx/esm/api";
|
|
7
6
|
//#region src/cli/cleanupExpiredData.ts
|
|
8
|
-
register();
|
|
9
7
|
var CleanupExpiredDataCommand = class {
|
|
10
8
|
logger;
|
|
11
9
|
constructor(logger) {
|
|
@@ -30,6 +28,8 @@ var CleanupExpiredDataCommand = class {
|
|
|
30
28
|
const schemaPath = `./dist/${filePath}`;
|
|
31
29
|
const fullSchemaPath = path.resolve(schemaPath);
|
|
32
30
|
if (!existsSync(fullSchemaPath)) return;
|
|
31
|
+
const { register } = await import("tsx/esm/api");
|
|
32
|
+
register();
|
|
33
33
|
return await import(fullSchemaPath);
|
|
34
34
|
}
|
|
35
35
|
createDbConnection(schema) {
|
package/dist/cli/runMigration.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { register } from "tsx/esm/api";
|
|
4
3
|
//#region src/cli/runMigration.ts
|
|
5
|
-
register();
|
|
6
4
|
var RunMigrationCommand = class {
|
|
7
5
|
logger;
|
|
8
6
|
db;
|
|
@@ -22,6 +20,8 @@ var RunMigrationCommand = class {
|
|
|
22
20
|
}
|
|
23
21
|
const startTime = Date.now();
|
|
24
22
|
const execScriptName = execDown ? "down" : "up";
|
|
23
|
+
const { register } = await import("tsx/esm/api");
|
|
24
|
+
register();
|
|
25
25
|
const { up, down } = await import(path.resolve(scriptPath));
|
|
26
26
|
this.logger.info(`Starting migration ${execScriptName}: ${fileName}`);
|
|
27
27
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diia-inhouse/db",
|
|
3
|
-
"version": "12.5.
|
|
3
|
+
"version": "12.5.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Package with database connection",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org --validate-https"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@diia-inhouse/crypto": "2.1.
|
|
43
|
+
"@diia-inhouse/crypto": "2.1.42",
|
|
44
44
|
"@diia-inhouse/diia-logger": "4.7.12",
|
|
45
45
|
"@diia-inhouse/diia-metrics": "7.1.139",
|
|
46
46
|
"@diia-inhouse/utils": "6.1.21",
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"rimraf": "6.1.3",
|
|
86
86
|
"semantic-release": "25.0.3",
|
|
87
87
|
"tsdown": "0.22.0",
|
|
88
|
+
"tsx": "4.22.4",
|
|
88
89
|
"typescript": "5.9.3",
|
|
89
90
|
"vitest": "4.1.11",
|
|
90
91
|
"vitest-mock-extended": "4.0.0"
|