@dbcube/schema-builder 5.0.9 → 5.0.11

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
@@ -1055,8 +1055,10 @@ var Schema = class {
1055
1055
  }
1056
1056
  const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1057
1057
  const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1058
- const fileEngine = new Engine(cubeDbName);
1059
- const dml = await fileEngine.run("schema_engine", [
1058
+ if (cubeDbName !== this.name) {
1059
+ continue;
1060
+ }
1061
+ const dml = await this.engine.run("schema_engine", [
1060
1062
  "--action",
1061
1063
  "parse_table",
1062
1064
  "--mode",
@@ -1069,7 +1071,7 @@ var Schema = class {
1069
1071
  break;
1070
1072
  }
1071
1073
  const parseJson = JSON.stringify(dml.data.actions).replace(/[\r\n\t]/g, "").replace(/\\[rnt]/g, "").replace(/\s{2,}/g, " ");
1072
- const queries = await fileEngine.run("schema_engine", [
1074
+ const queries = await this.engine.run("schema_engine", [
1073
1075
  "--action",
1074
1076
  "generate",
1075
1077
  "--mode",
@@ -1083,7 +1085,7 @@ var Schema = class {
1083
1085
  }
1084
1086
  delete queries.data.database_type;
1085
1087
  const parseJsonQueries = JSON.stringify(queries.data);
1086
- const response = await fileEngine.run("schema_engine", [
1088
+ const response = await this.engine.run("schema_engine", [
1087
1089
  "--action",
1088
1090
  "execute",
1089
1091
  "--mode",
@@ -1180,8 +1182,10 @@ var Schema = class {
1180
1182
  }
1181
1183
  const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1182
1184
  const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1183
- const fileEngine = new Engine(cubeDbName);
1184
- const dml = await fileEngine.run("schema_engine", [
1185
+ if (cubeDbName !== this.name) {
1186
+ continue;
1187
+ }
1188
+ const dml = await this.engine.run("schema_engine", [
1185
1189
  "--action",
1186
1190
  "parse_table",
1187
1191
  "--schema-path",
@@ -1194,7 +1198,7 @@ var Schema = class {
1194
1198
  break;
1195
1199
  }
1196
1200
  const parseJson = JSON.stringify(dml.data.actions).replace(/[\r\n\t]/g, "").replace(/\\[rnt]/g, "").replace(/\s{2,}/g, " ");
1197
- const queries = await fileEngine.run("schema_engine", [
1201
+ const queries = await this.engine.run("schema_engine", [
1198
1202
  "--action",
1199
1203
  "generate",
1200
1204
  "--dml",
@@ -1207,7 +1211,7 @@ var Schema = class {
1207
1211
  delete queries.data._type;
1208
1212
  const createQuery = queries.data.regular_queries.filter((q) => q.includes("CREATE"))[0];
1209
1213
  const parseJsonQueries = JSON.stringify(queries.data);
1210
- const response = await fileEngine.run("schema_engine", [
1214
+ const response = await this.engine.run("schema_engine", [
1211
1215
  "--action",
1212
1216
  "execute",
1213
1217
  "--mode",
@@ -1285,8 +1289,10 @@ var Schema = class {
1285
1289
  }
1286
1290
  const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1287
1291
  const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1288
- const fileEngine = new Engine(cubeDbName);
1289
- const response = await fileEngine.run("schema_engine", [
1292
+ if (cubeDbName !== this.name) {
1293
+ continue;
1294
+ }
1295
+ const response = await this.engine.run("schema_engine", [
1290
1296
  "--action",
1291
1297
  "seeder",
1292
1298
  "--schema-path",
@@ -1360,8 +1366,10 @@ var Schema = class {
1360
1366
  }
1361
1367
  const dbResult = FileUtils_default.extractDatabaseNameFromCube(filePath);
1362
1368
  const cubeDbName = dbResult.status === 200 ? dbResult.message : this.name;
1363
- const fileEngine = new Engine(cubeDbName);
1364
- const response = await fileEngine.run("schema_engine", [
1369
+ if (cubeDbName !== this.name) {
1370
+ continue;
1371
+ }
1372
+ const response = await this.engine.run("schema_engine", [
1365
1373
  "--action",
1366
1374
  "trigger",
1367
1375
  "--path-exit",