@dbcube/cli 5.1.2 → 5.1.3
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.lock
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"": {
|
|
5
5
|
"name": "@dbcube/cli",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dbcube/schema-builder": "^5.1.
|
|
7
|
+
"@dbcube/schema-builder": "^5.1.5",
|
|
8
8
|
"@inquirer/prompts": "^8.4.2",
|
|
9
9
|
"alwait": "^1.0.0",
|
|
10
10
|
"chalk": "4.1.2",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"ora": "5.4.1",
|
|
22
22
|
},
|
|
23
23
|
"packages": {
|
|
24
|
-
"@dbcube/core": ["@dbcube/core@5.1.
|
|
24
|
+
"@dbcube/core": ["@dbcube/core@5.1.12", "", { "dependencies": { "chalk": "4.1.2", "deasync": "^0.1.31", "follow-redirects": "^1.16.0", "ora": "5.4.1", "unzipper": "^0.12.3" }, "bin": { "dbcube-core": "dist/bin.cjs" } }, "sha512-s98vjAdkVTht1DdE16HzrWu2kgpWSVBGINuSRM4l+blgn7sSZTjWoT31rwd8srnhnZf3Cld0HvHiCq2qIArCHg=="],
|
|
25
25
|
|
|
26
|
-
"@dbcube/schema-builder": ["@dbcube/schema-builder@5.1.
|
|
26
|
+
"@dbcube/schema-builder": ["@dbcube/schema-builder@5.1.5", "", { "dependencies": { "@dbcube/core": "^5.1.12", "chalk": "^5.6.2", "ora": "^9.4.0" } }, "sha512-zKzu8Wg8KKCCDI6OBsChQ+qp7QUnUwdIQbHMUZQnPWQLuPk+5kFcgJbYMfFevzVW5uy0VD0kK3F9gd2Z1VuLOw=="],
|
|
27
27
|
|
|
28
28
|
"@inquirer/ansi": ["@inquirer/ansi@2.0.5", "", {}, "sha512-doc2sWgJpbFQ64UflSVd17ibMGDuxO1yKgOgLMwavzESnXjFWJqUeG8saYosqKpHp4kWiM5x1nXvEjbpx90gzw=="],
|
|
29
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbcube/cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dbcube": "node src/index.js"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"description": "",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dbcube/schema-builder": "^5.1.
|
|
16
|
+
"@dbcube/schema-builder": "^5.1.5",
|
|
17
17
|
"@inquirer/prompts": "^8.4.2",
|
|
18
18
|
"alwait": "^1.0.0",
|
|
19
19
|
"chalk": "4.1.2",
|
|
@@ -3,12 +3,14 @@ const ConfigFileUtils = require('./../../../utils/ConfigFileUtils');
|
|
|
3
3
|
|
|
4
4
|
async function main() {
|
|
5
5
|
try {
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const seederName = args.find(a => !a.startsWith('--'));
|
|
8
|
+
|
|
6
9
|
const configuredDatabases = await ConfigFileUtils.getConfiguredDatabases();
|
|
7
10
|
|
|
8
|
-
// Recorrer cada archivo y mostrar su contenido
|
|
9
11
|
for (const config of configuredDatabases) {
|
|
10
12
|
const schema = new Schema(config.name);
|
|
11
|
-
await schema.executeSeeders();
|
|
13
|
+
await schema.executeSeeders(seederName);
|
|
12
14
|
}
|
|
13
15
|
} catch (error) {
|
|
14
16
|
if (error.message.includes("reading 'init'")) {
|
|
@@ -3,12 +3,17 @@ const ConfigFileUtils = require('./../../../utils/ConfigFileUtils');
|
|
|
3
3
|
|
|
4
4
|
async function main() {
|
|
5
5
|
try {
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const runSeeders = args.includes('--seeder');
|
|
8
|
+
|
|
6
9
|
const configuredDatabases = await ConfigFileUtils.getConfiguredDatabases();
|
|
7
10
|
|
|
8
|
-
// Recorrer cada archivo y mostrar su contenido
|
|
9
11
|
for (const config of configuredDatabases) {
|
|
10
12
|
const schema = new Schema(config.name);
|
|
11
13
|
await schema.freshTables();
|
|
14
|
+
if (runSeeders) {
|
|
15
|
+
await schema.executeSeeders();
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
18
|
} catch (error) {
|
|
14
19
|
if (error.message.includes("reading 'init'")) {
|