@dbml/cli 8.0.0-alpha.1 → 8.0.0-alpha.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/__tests__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
- package/__tests__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
- package/__tests__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
- package/__tests__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +1 -1
- package/__tests__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +1 -1
- package/__tests__/dbml2sql/syntax-error/dbml-error.log +5 -0
- package/__tests__/sql2dbml/custom-error-alter-table-column-not-found --oracle/dbml-error.log +4 -0
- package/__tests__/sql2dbml/custom-error-alter-table-table-not-found --oracle/dbml-error.log +4 -0
- package/__tests__/sql2dbml/custom-error-column-comment-column-not-found --oracle/dbml-error.log +4 -0
- package/__tests__/sql2dbml/custom-error-column-comment-table-not-found --oracle/dbml-error.log +4 -0
- package/__tests__/sql2dbml/custom-error-create-index-table-not-found --oracle/dbml-error.log +4 -0
- package/__tests__/sql2dbml/custom-error-table-comment-table-not-found --oracle/dbml-error.log +4 -0
- package/__tests__/sql2dbml/syntax-error/dbml-error.log +4 -0
- package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +4 -0
- package/lib/index.js +6 -4
- package/package.json +2 -2
- package/src/cli/connector.ts +1 -1
- package/src/helpers/logger.ts +3 -3
|
@@ -111,3 +111,7 @@ undefined
|
|
|
111
111
|
2026-05-06T08:18:03.492Z
|
|
112
112
|
undefined
|
|
113
113
|
|
|
114
|
+
2026-05-06T08:32:30.153Z
|
|
115
|
+
|
|
116
|
+
You have a syntax error at "business.sql" line 6 column 2. no viable alternative at input 'CREATE TABLE `staff` (\n `id` int PRIMARY KEY,\n `first_name` varchar(255),\n `last_name` varchar(255),\n `address_id` int\n `picture`'
|
|
117
|
+
|
|
@@ -108,3 +108,7 @@ undefined
|
|
|
108
108
|
2026-05-06T08:18:04.905Z
|
|
109
109
|
undefined
|
|
110
110
|
|
|
111
|
+
2026-05-06T08:32:31.718Z
|
|
112
|
+
|
|
113
|
+
You have a syntax error at "schema.sql" line 1 column 1. Reference with the same endpoints already exists: "student"("subject_id", "score_id") references "score_subject"("subject_id", "score_id")
|
|
114
|
+
|
package/lib/index.js
CHANGED
|
@@ -29,6 +29,8 @@ let chalk = require("chalk");
|
|
|
29
29
|
chalk = __toESM(chalk);
|
|
30
30
|
let figures = require("figures");
|
|
31
31
|
figures = __toESM(figures);
|
|
32
|
+
let strip_ansi = require("strip-ansi");
|
|
33
|
+
strip_ansi = __toESM(strip_ansi);
|
|
32
34
|
let winston = require("winston");
|
|
33
35
|
let fs = require("fs");
|
|
34
36
|
fs = __toESM(fs);
|
|
@@ -36,7 +38,7 @@ let __dbml_parse = require("@dbml/parse");
|
|
|
36
38
|
let node_fs = require("node:fs");
|
|
37
39
|
const $schema = "https://json.schemastore.org/package";
|
|
38
40
|
const name = "@dbml/cli";
|
|
39
|
-
const version = "8.0.0-alpha.
|
|
41
|
+
const version = "8.0.0-alpha.3";
|
|
40
42
|
const description = "";
|
|
41
43
|
const main = "lib/index.js";
|
|
42
44
|
const license = "Apache-2.0";
|
|
@@ -75,7 +77,7 @@ const dependencies = {
|
|
|
75
77
|
"strip-ansi": "^5.2.0",
|
|
76
78
|
"winston": "^3.2.1"
|
|
77
79
|
};
|
|
78
|
-
const gitHead = "
|
|
80
|
+
const gitHead = "55f87cb7b6c94255df93d5f486b4630b4cff9542";
|
|
79
81
|
const engines = { "node": ">=18" };
|
|
80
82
|
var package_default = {
|
|
81
83
|
$schema,
|
|
@@ -103,8 +105,8 @@ var consoleFormat = printf((info) => {
|
|
|
103
105
|
${path.default.resolve(process.cwd(), "dbml-error.log")}`;
|
|
104
106
|
});
|
|
105
107
|
var fileFormat = printf((info) => {
|
|
106
|
-
const { timestamp: ts, stack, rootError } = info;
|
|
107
|
-
let logContent = `${ts}\n${stack}\n`;
|
|
108
|
+
const { timestamp: ts, message, stack, rootError } = info;
|
|
109
|
+
let logContent = `${ts}\n${(0, strip_ansi.default)(stack ?? message ?? "")}\n`;
|
|
108
110
|
if (rootError) {
|
|
109
111
|
logContent += "\nROOT_ERROR:";
|
|
110
112
|
logContent += `\n${rootError.stack}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/cli",
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.3",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"strip-ansi": "^5.2.0",
|
|
46
46
|
"winston": "^3.2.1"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "55f87cb7b6c94255df93d5f486b4630b4cff9542",
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=18"
|
|
51
51
|
}
|
package/src/cli/connector.ts
CHANGED
|
@@ -37,6 +37,6 @@ export default async function connectionHandler (program: Command) {
|
|
|
37
37
|
console.log(` ${chalk.green(figures.main.tick)} Generated DBML file from database's connection: ${path.basename(opts.outFile)}`);
|
|
38
38
|
}
|
|
39
39
|
} catch (error) {
|
|
40
|
-
logger.error(error);
|
|
40
|
+
logger.error(error as Error | string);
|
|
41
41
|
}
|
|
42
42
|
}
|
package/src/helpers/logger.ts
CHANGED
|
@@ -20,9 +20,9 @@ const consoleFormat = printf((info) => {
|
|
|
20
20
|
|
|
21
21
|
const fileFormat = printf((info) => {
|
|
22
22
|
const {
|
|
23
|
-
timestamp: ts, stack, rootError,
|
|
23
|
+
timestamp: ts, message, stack, rootError,
|
|
24
24
|
} = info as any;
|
|
25
|
-
let logContent = `${ts}\n${stack}\n`;
|
|
25
|
+
let logContent = `${ts}\n${stripAnsi(stack ?? message ?? '')}\n`;
|
|
26
26
|
if (rootError) {
|
|
27
27
|
logContent += '\nROOT_ERROR:';
|
|
28
28
|
logContent += `\n${rootError.stack}`;
|
|
@@ -69,7 +69,7 @@ const logger = {
|
|
|
69
69
|
consoleLogger.warn(msg);
|
|
70
70
|
},
|
|
71
71
|
|
|
72
|
-
error (msg:
|
|
72
|
+
error (msg: Error | string) {
|
|
73
73
|
consoleLogger.error(msg);
|
|
74
74
|
fileLogger.error(msg);
|
|
75
75
|
},
|