@dbcube/schema-builder 5.0.6 → 5.0.9

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/bun.lockb CHANGED
Binary file
package/dist/index.cjs CHANGED
@@ -1093,7 +1093,10 @@ var Schema = class {
1093
1093
  errorCount++;
1094
1094
  continue;
1095
1095
  }
1096
- const dml = await this.engine.run("schema_engine", [
1096
+ const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1097
+ const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1098
+ const fileEngine = new import_core.Engine(cubeDbName);
1099
+ const dml = await fileEngine.run("schema_engine", [
1097
1100
  "--action",
1098
1101
  "parse_table",
1099
1102
  "--mode",
@@ -1106,7 +1109,7 @@ var Schema = class {
1106
1109
  break;
1107
1110
  }
1108
1111
  const parseJson = JSON.stringify(dml.data.actions).replace(/[\r\n\t]/g, "").replace(/\\[rnt]/g, "").replace(/\s{2,}/g, " ");
1109
- const queries = await this.engine.run("schema_engine", [
1112
+ const queries = await fileEngine.run("schema_engine", [
1110
1113
  "--action",
1111
1114
  "generate",
1112
1115
  "--mode",
@@ -1120,7 +1123,7 @@ var Schema = class {
1120
1123
  }
1121
1124
  delete queries.data.database_type;
1122
1125
  const parseJsonQueries = JSON.stringify(queries.data);
1123
- const response = await this.engine.run("schema_engine", [
1126
+ const response = await fileEngine.run("schema_engine", [
1124
1127
  "--action",
1125
1128
  "execute",
1126
1129
  "--mode",
@@ -1215,7 +1218,10 @@ var Schema = class {
1215
1218
  errorCount++;
1216
1219
  continue;
1217
1220
  }
1218
- const dml = await this.engine.run("schema_engine", [
1221
+ const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1222
+ const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1223
+ const fileEngine = new import_core.Engine(cubeDbName);
1224
+ const dml = await fileEngine.run("schema_engine", [
1219
1225
  "--action",
1220
1226
  "parse_table",
1221
1227
  "--schema-path",
@@ -1228,7 +1234,7 @@ var Schema = class {
1228
1234
  break;
1229
1235
  }
1230
1236
  const parseJson = JSON.stringify(dml.data.actions).replace(/[\r\n\t]/g, "").replace(/\\[rnt]/g, "").replace(/\s{2,}/g, " ");
1231
- const queries = await this.engine.run("schema_engine", [
1237
+ const queries = await fileEngine.run("schema_engine", [
1232
1238
  "--action",
1233
1239
  "generate",
1234
1240
  "--dml",
@@ -1241,7 +1247,7 @@ var Schema = class {
1241
1247
  delete queries.data._type;
1242
1248
  const createQuery = queries.data.regular_queries.filter((q) => q.includes("CREATE"))[0];
1243
1249
  const parseJsonQueries = JSON.stringify(queries.data);
1244
- const response = await this.engine.run("schema_engine", [
1250
+ const response = await fileEngine.run("schema_engine", [
1245
1251
  "--action",
1246
1252
  "execute",
1247
1253
  "--mode",
@@ -1317,7 +1323,10 @@ var Schema = class {
1317
1323
  errorCount++;
1318
1324
  continue;
1319
1325
  }
1320
- const response = await this.engine.run("schema_engine", [
1326
+ const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1327
+ const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1328
+ const fileEngine = new import_core.Engine(cubeDbName);
1329
+ const response = await fileEngine.run("schema_engine", [
1321
1330
  "--action",
1322
1331
  "seeder",
1323
1332
  "--schema-path",
@@ -1389,7 +1398,10 @@ var Schema = class {
1389
1398
  errorCount++;
1390
1399
  continue;
1391
1400
  }
1392
- const response = await this.engine.run("schema_engine", [
1401
+ const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1402
+ const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1403
+ const fileEngine = new import_core.Engine(cubeDbName);
1404
+ const response = await fileEngine.run("schema_engine", [
1393
1405
  "--action",
1394
1406
  "trigger",
1395
1407
  "--path-exit",