@cadenza.io/service 2.2.0 → 2.2.1
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 +10 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2436,6 +2436,13 @@ var DatabaseController = class _DatabaseController {
|
|
|
2436
2436
|
`Invalid database name ${databaseName}. Names must only contain lowercase alphanumeric characters and underscores`
|
|
2437
2437
|
);
|
|
2438
2438
|
}
|
|
2439
|
+
console.log(`Creating database ${databaseName}`, {
|
|
2440
|
+
user: process.env.DATABASE_USER ?? "postgres",
|
|
2441
|
+
host: process.env.DATABASE_ADDRESS ?? "localhost",
|
|
2442
|
+
port: parseInt(process.env.DATABASE_PORT ?? "5432"),
|
|
2443
|
+
database: "postgres",
|
|
2444
|
+
password: process.env.DATABASE_PASSWORD ?? "03gibnEF"
|
|
2445
|
+
});
|
|
2439
2446
|
await this.dbClient.query(`CREATE DATABASE ${databaseName}`);
|
|
2440
2447
|
console.log(`Database ${databaseName} created`);
|
|
2441
2448
|
this.dbClient = new Pool({
|
|
@@ -2452,6 +2459,7 @@ var DatabaseController = class _DatabaseController {
|
|
|
2452
2459
|
console.log("Database already exists");
|
|
2453
2460
|
return true;
|
|
2454
2461
|
}
|
|
2462
|
+
console.error("Failed to create database", error);
|
|
2455
2463
|
throw new Error(`Failed to create database: ${error.message}`);
|
|
2456
2464
|
}
|
|
2457
2465
|
},
|
|
@@ -2804,6 +2812,7 @@ var DatabaseController = class _DatabaseController {
|
|
|
2804
2812
|
if (ddl && ddl.length > 0) {
|
|
2805
2813
|
for (const sql of ddl) {
|
|
2806
2814
|
try {
|
|
2815
|
+
console.log("Executing DDL", sql);
|
|
2807
2816
|
await this.dbClient.query(sql);
|
|
2808
2817
|
} catch (error) {
|
|
2809
2818
|
console.error(
|
|
@@ -4740,6 +4749,7 @@ var CadenzaService = class {
|
|
|
4740
4749
|
isDatabase: true,
|
|
4741
4750
|
...options
|
|
4742
4751
|
};
|
|
4752
|
+
console.log("Creating database service", options);
|
|
4743
4753
|
this.emit("meta.database_init_requested", {
|
|
4744
4754
|
schema,
|
|
4745
4755
|
databaseName: options.databaseName,
|