@dbcube/schema-builder
Advanced tools
+10
-3
@@ -295,3 +295,3 @@ "use strict"; | ||
| var CubeValidator = class { | ||
| validTypes = ["varchar", "int", "string", "text", "boolean", "date", "datetime", "timestamp", "decimal", "float", "double", "enum", "json"]; | ||
| validTypes = ["varchar", "int", "tinyint", "bigint", "string", "text", "boolean", "date", "datetime", "timestamp", "decimal", "float", "double", "enum", "json"]; | ||
| validOptions = ["not null", "primary", "autoincrement", "unique", "zerofill", "index", "required", "unsigned"]; | ||
@@ -1353,3 +1353,3 @@ validProperties = ["type", "length", "options", "value", "defaultValue", "foreign", "enumValues", "description"]; | ||
| } | ||
| async executeSeeders() { | ||
| async executeSeeders(filterName) { | ||
| const startTime = Date.now(); | ||
@@ -1360,6 +1360,13 @@ const cubesDir = import_path3.default.join(process.cwd(), "dbcube"); | ||
| } | ||
| const cubeFiles = FileUtils_default.getCubeFilesRecursively("dbcube", ".seeder.cube"); | ||
| let cubeFiles = FileUtils_default.getCubeFilesRecursively("dbcube", ".seeder.cube"); | ||
| if (cubeFiles.length === 0) { | ||
| throw new Error("\u274C There are no cubes to execute"); | ||
| } | ||
| if (filterName) { | ||
| const normalized = filterName.replace(/\.seeder\.cube$/, "").replace(/\.seeder$/, ""); | ||
| cubeFiles = cubeFiles.filter((file) => import_path3.default.basename(file, ".seeder.cube") === normalized); | ||
| if (cubeFiles.length === 0) { | ||
| throw new Error(`\u274C Seeder '${filterName}' not found. Make sure the file '${normalized}.seeder.cube' exists in the dbcube folder.`); | ||
| } | ||
| } | ||
| const orderedCubeFiles = DependencyResolver.orderCubeFiles(cubeFiles, "seeder"); | ||
@@ -1366,0 +1373,0 @@ UIUtils.showOperationHeader("EXECUTING SEEDERS", this.name, "\u{1F331}"); |
+1
-1
@@ -30,3 +30,3 @@ /** | ||
| freshTables(): Promise<any>; | ||
| executeSeeders(): Promise<any>; | ||
| executeSeeders(filterName?: string): Promise<any>; | ||
| executeAlters(): Promise<any>; | ||
@@ -33,0 +33,0 @@ executeTriggers(): Promise<any>; |
+1
-1
@@ -30,3 +30,3 @@ /** | ||
| freshTables(): Promise<any>; | ||
| executeSeeders(): Promise<any>; | ||
| executeSeeders(filterName?: string): Promise<any>; | ||
| executeAlters(): Promise<any>; | ||
@@ -33,0 +33,0 @@ executeTriggers(): Promise<any>; |
+10
-3
@@ -255,3 +255,3 @@ // src/lib/Schema.ts | ||
| var CubeValidator = class { | ||
| validTypes = ["varchar", "int", "string", "text", "boolean", "date", "datetime", "timestamp", "decimal", "float", "double", "enum", "json"]; | ||
| validTypes = ["varchar", "int", "tinyint", "bigint", "string", "text", "boolean", "date", "datetime", "timestamp", "decimal", "float", "double", "enum", "json"]; | ||
| validOptions = ["not null", "primary", "autoincrement", "unique", "zerofill", "index", "required", "unsigned"]; | ||
@@ -1313,3 +1313,3 @@ validProperties = ["type", "length", "options", "value", "defaultValue", "foreign", "enumValues", "description"]; | ||
| } | ||
| async executeSeeders() { | ||
| async executeSeeders(filterName) { | ||
| const startTime = Date.now(); | ||
@@ -1320,6 +1320,13 @@ const cubesDir = path4.join(process.cwd(), "dbcube"); | ||
| } | ||
| const cubeFiles = FileUtils_default.getCubeFilesRecursively("dbcube", ".seeder.cube"); | ||
| let cubeFiles = FileUtils_default.getCubeFilesRecursively("dbcube", ".seeder.cube"); | ||
| if (cubeFiles.length === 0) { | ||
| throw new Error("\u274C There are no cubes to execute"); | ||
| } | ||
| if (filterName) { | ||
| const normalized = filterName.replace(/\.seeder\.cube$/, "").replace(/\.seeder$/, ""); | ||
| cubeFiles = cubeFiles.filter((file) => path4.basename(file, ".seeder.cube") === normalized); | ||
| if (cubeFiles.length === 0) { | ||
| throw new Error(`\u274C Seeder '${filterName}' not found. Make sure the file '${normalized}.seeder.cube' exists in the dbcube folder.`); | ||
| } | ||
| } | ||
| const orderedCubeFiles = DependencyResolver.orderCubeFiles(cubeFiles, "seeder"); | ||
@@ -1326,0 +1333,0 @@ UIUtils.showOperationHeader("EXECUTING SEEDERS", this.name, "\u{1F331}"); |
+3
-3
| { | ||
| "name": "@dbcube/schema-builder", | ||
| "version": "5.1.4", | ||
| "version": "5.1.5", | ||
| "description": "The Dbcube Query Builder is a lightweight, flexible, and fluent library for building queries across multiple database engines, including MySQL, PostgreSQL, SQLite, and MongoDB, using JavaScript/Node.js. \nIts agnostic design allows you to generate data manipulation (DML) and data definition (DDL) operations with a clean, chainable syntax—without sacrificing power or expressiveness.\nIt’s designed to work seamlessly in both SQL and NoSQL environments, providing a consistent abstraction layer across different storage technologies while still leveraging the native capabilities of each engine.", | ||
@@ -57,3 +57,3 @@ "main": "dist/index.cjs", | ||
| "dependencies": { | ||
| "@dbcube/core": "^5.1.11", | ||
| "@dbcube/core": "^5.1.12", | ||
| "chalk": "^5.6.2", | ||
@@ -69,3 +69,3 @@ "ora": "^9.4.0" | ||
| "dts-bundle-generator": "^9.5.1", | ||
| "rollup": "^4.60.2", | ||
| "rollup": "^4.60.3", | ||
| "tsup": "^8.5.1", | ||
@@ -72,0 +72,0 @@ "typescript": "^6.0.3" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
493345
0.5%3424
0.41%12
-7.69%Updated