@dbcube/schema-builder 5.1.4 → 5.1.6

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
@@ -292,7 +292,7 @@ ${import_chalk.default.red("\u{1F6AB}")} ${import_chalk.default.bold.red("ERRORS
292
292
  var import_fs2 = __toESM(require("fs"));
293
293
  var import_path = __toESM(require("path"));
294
294
  var CubeValidator = class {
295
- validTypes = ["varchar", "int", "string", "text", "boolean", "date", "datetime", "timestamp", "decimal", "float", "double", "enum", "json"];
295
+ validTypes = ["varchar", "int", "tinyint", "bigint", "string", "text", "boolean", "date", "datetime", "timestamp", "decimal", "float", "double", "enum", "json"];
296
296
  validOptions = ["not null", "primary", "autoincrement", "unique", "zerofill", "index", "required", "unsigned"];
297
297
  validProperties = ["type", "length", "options", "value", "defaultValue", "foreign", "enumValues", "description"];
298
298
  knownAnnotations = ["database", "table", "meta", "columns", "indexes", "fields", "dataset", "beforeAdd", "afterAdd", "beforeUpdate", "afterUpdate", "beforeDelete", "afterDelete", "compute", "column", "changeName", "addColumn", "deleteColumn", "renameColumn", "changeType", "changeLength", "changeDefault", "changeOptions", "changeEnumValues"];
@@ -1349,16 +1349,23 @@ var Schema = class {
1349
1349
  UIUtils.showOperationSummary(summary);
1350
1350
  return totalTablesProcessed > 0 ? { processed: totalTablesProcessed, success: successCount, errors: errorCount } : null;
1351
1351
  }
1352
- async executeSeeders() {
1352
+ async executeSeeders(filterName) {
1353
1353
  const startTime = Date.now();
1354
1354
  const cubesDir = import_path3.default.join(process.cwd(), "dbcube");
1355
1355
  if (!import_fs4.default.existsSync(cubesDir)) {
1356
1356
  throw new Error("\u274C The cubes folder does not exist");
1357
1357
  }
1358
- const cubeFiles = FileUtils_default.getCubeFilesRecursively("dbcube", ".seeder.cube");
1358
+ let cubeFiles = FileUtils_default.getCubeFilesRecursively("dbcube", ".seeder.cube");
1359
1359
  if (cubeFiles.length === 0) {
1360
1360
  throw new Error("\u274C There are no cubes to execute");
1361
1361
  }
1362
+ if (filterName) {
1363
+ const normalized = filterName.replace(/\.seeder\.cube$/, "").replace(/\.seeder$/, "");
1364
+ cubeFiles = cubeFiles.filter((file) => import_path3.default.basename(file, ".seeder.cube") === normalized);
1365
+ if (cubeFiles.length === 0) {
1366
+ throw new Error(`\u274C Seeder '${filterName}' not found. Make sure the file '${normalized}.seeder.cube' exists in the dbcube folder.`);
1367
+ }
1368
+ }
1362
1369
  const orderedCubeFiles = DependencyResolver.orderCubeFiles(cubeFiles, "seeder");
1363
1370
  UIUtils.showOperationHeader("EXECUTING SEEDERS", this.name, "\u{1F331}");
1364
1371
  let totalSeedersProcessed = 0;