@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 CHANGED
@@ -2484,6 +2484,13 @@ var DatabaseController = class _DatabaseController {
2484
2484
  `Invalid database name ${databaseName}. Names must only contain lowercase alphanumeric characters and underscores`
2485
2485
  );
2486
2486
  }
2487
+ console.log(`Creating database ${databaseName}`, {
2488
+ user: process.env.DATABASE_USER ?? "postgres",
2489
+ host: process.env.DATABASE_ADDRESS ?? "localhost",
2490
+ port: parseInt(process.env.DATABASE_PORT ?? "5432"),
2491
+ database: "postgres",
2492
+ password: process.env.DATABASE_PASSWORD ?? "03gibnEF"
2493
+ });
2487
2494
  await this.dbClient.query(`CREATE DATABASE ${databaseName}`);
2488
2495
  console.log(`Database ${databaseName} created`);
2489
2496
  this.dbClient = new import_pg.Pool({
@@ -2500,6 +2507,7 @@ var DatabaseController = class _DatabaseController {
2500
2507
  console.log("Database already exists");
2501
2508
  return true;
2502
2509
  }
2510
+ console.error("Failed to create database", error);
2503
2511
  throw new Error(`Failed to create database: ${error.message}`);
2504
2512
  }
2505
2513
  },
@@ -2852,6 +2860,7 @@ var DatabaseController = class _DatabaseController {
2852
2860
  if (ddl && ddl.length > 0) {
2853
2861
  for (const sql of ddl) {
2854
2862
  try {
2863
+ console.log("Executing DDL", sql);
2855
2864
  await this.dbClient.query(sql);
2856
2865
  } catch (error) {
2857
2866
  console.error(
@@ -4788,6 +4797,7 @@ var CadenzaService = class {
4788
4797
  isDatabase: true,
4789
4798
  ...options
4790
4799
  };
4800
+ console.log("Creating database service", options);
4791
4801
  this.emit("meta.database_init_requested", {
4792
4802
  schema,
4793
4803
  databaseName: options.databaseName,