@cadenza.io/service 2.2.0 → 2.2.2
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 +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2466,7 +2466,11 @@ var DatabaseController = class _DatabaseController {
|
|
|
2466
2466
|
host: process.env.DATABASE_ADDRESS ?? "localhost",
|
|
2467
2467
|
port: parseInt(process.env.DATABASE_PORT ?? "5432"),
|
|
2468
2468
|
database: "postgres",
|
|
2469
|
-
password: process.env.DATABASE_PASSWORD ?? "03gibnEF"
|
|
2469
|
+
password: process.env.DATABASE_PASSWORD ?? "03gibnEF",
|
|
2470
|
+
ssl: {
|
|
2471
|
+
rejectUnauthorized: false
|
|
2472
|
+
// ← This bypasses the chain validation error
|
|
2473
|
+
}
|
|
2470
2474
|
});
|
|
2471
2475
|
CadenzaService.createMetaRoutine(
|
|
2472
2476
|
"DatabaseServiceInit",
|
|
@@ -2484,6 +2488,13 @@ var DatabaseController = class _DatabaseController {
|
|
|
2484
2488
|
`Invalid database name ${databaseName}. Names must only contain lowercase alphanumeric characters and underscores`
|
|
2485
2489
|
);
|
|
2486
2490
|
}
|
|
2491
|
+
console.log(`Creating database ${databaseName}`, {
|
|
2492
|
+
user: process.env.DATABASE_USER ?? "postgres",
|
|
2493
|
+
host: process.env.DATABASE_ADDRESS ?? "localhost",
|
|
2494
|
+
port: parseInt(process.env.DATABASE_PORT ?? "5432"),
|
|
2495
|
+
database: "postgres",
|
|
2496
|
+
password: process.env.DATABASE_PASSWORD ?? "03gibnEF"
|
|
2497
|
+
});
|
|
2487
2498
|
await this.dbClient.query(`CREATE DATABASE ${databaseName}`);
|
|
2488
2499
|
console.log(`Database ${databaseName} created`);
|
|
2489
2500
|
this.dbClient = new import_pg.Pool({
|
|
@@ -2491,7 +2502,11 @@ var DatabaseController = class _DatabaseController {
|
|
|
2491
2502
|
host: process.env.DATABASE_ADDRESS ?? "localhost",
|
|
2492
2503
|
port: parseInt(process.env.DATABASE_PORT ?? "5432"),
|
|
2493
2504
|
database: databaseName,
|
|
2494
|
-
password: process.env.DATABASE_PASSWORD ?? "03gibnEF"
|
|
2505
|
+
password: process.env.DATABASE_PASSWORD ?? "03gibnEF",
|
|
2506
|
+
ssl: {
|
|
2507
|
+
rejectUnauthorized: false
|
|
2508
|
+
// ← This bypasses the chain validation error
|
|
2509
|
+
}
|
|
2495
2510
|
});
|
|
2496
2511
|
this.databaseName = databaseName;
|
|
2497
2512
|
return true;
|
|
@@ -2500,6 +2515,7 @@ var DatabaseController = class _DatabaseController {
|
|
|
2500
2515
|
console.log("Database already exists");
|
|
2501
2516
|
return true;
|
|
2502
2517
|
}
|
|
2518
|
+
console.error("Failed to create database", error);
|
|
2503
2519
|
throw new Error(`Failed to create database: ${error.message}`);
|
|
2504
2520
|
}
|
|
2505
2521
|
},
|
|
@@ -2852,6 +2868,7 @@ var DatabaseController = class _DatabaseController {
|
|
|
2852
2868
|
if (ddl && ddl.length > 0) {
|
|
2853
2869
|
for (const sql of ddl) {
|
|
2854
2870
|
try {
|
|
2871
|
+
console.log("Executing DDL", sql);
|
|
2855
2872
|
await this.dbClient.query(sql);
|
|
2856
2873
|
} catch (error) {
|
|
2857
2874
|
console.error(
|
|
@@ -4788,6 +4805,7 @@ var CadenzaService = class {
|
|
|
4788
4805
|
isDatabase: true,
|
|
4789
4806
|
...options
|
|
4790
4807
|
};
|
|
4808
|
+
console.log("Creating database service", options);
|
|
4791
4809
|
this.emit("meta.database_init_requested", {
|
|
4792
4810
|
schema,
|
|
4793
4811
|
databaseName: options.databaseName,
|