@dbml/cli 3.12.0-alpha-0 → 3.12.0
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/__test__/sql2dbml/filename --mssql --out-file/expect-out-files/schema.dbml +3 -3
- package/__test__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +3 -3
- package/__test__/sql2dbml/multiple_schema_mssql/expect-out-files/multiple_schema.out.dbml +28 -28
- package/__test__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +28 -28
- package/__test__/sql2dbml/syntax-error/dbml-error.log +24 -0
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +24 -0
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/stdout.txt +1 -1
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +24 -0
- package/dbml-error.log +9 -0
- package/lib/cli/index.js +1 -1
- package/lib/cli/utils.js +1 -1
- package/package.json +4 -4
- package/src/cli/index.js +1 -0
- package/src/cli/utils.js +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Table "UserMaster" {
|
|
2
|
-
"UserMasterKey" BIGINT [not null
|
|
2
|
+
"UserMasterKey" "BIGINT IDENTITY(1,1)" [not null]
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
Table "CodeDef" {
|
|
6
|
-
"CdKey" BIGINT [not null
|
|
6
|
+
"CdKey" "BIGINT IDENTITY(1,1)" [not null]
|
|
7
7
|
"Category" NVARCHAR(50) [not null]
|
|
8
8
|
"Description" NVARCHAR(100)
|
|
9
9
|
"Code" NVARCHAR(50) [not null]
|
|
@@ -16,7 +16,7 @@ Table "CodeDef" {
|
|
|
16
16
|
"EffectiveThruDtTm" DATETIMEOFFSET(7)
|
|
17
17
|
|
|
18
18
|
Indexes {
|
|
19
|
-
CdKey [pk]
|
|
19
|
+
CdKey [pk, name: "PK__CodeDef__4922449ECDD244C3"]
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Table "UserMaster" {
|
|
2
|
-
"UserMasterKey" BIGINT [not null
|
|
2
|
+
"UserMasterKey" "BIGINT IDENTITY(1,1)" [not null]
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
Table "CodeDef" {
|
|
6
|
-
"CdKey" BIGINT [not null
|
|
6
|
+
"CdKey" "BIGINT IDENTITY(1,1)" [not null]
|
|
7
7
|
"Category" NVARCHAR(50) [not null]
|
|
8
8
|
"Description" NVARCHAR(100)
|
|
9
9
|
"Code" NVARCHAR(50) [not null]
|
|
@@ -16,7 +16,7 @@ Table "CodeDef" {
|
|
|
16
16
|
"EffectiveThruDtTm" DATETIMEOFFSET(7)
|
|
17
17
|
|
|
18
18
|
Indexes {
|
|
19
|
-
CdKey [pk]
|
|
19
|
+
CdKey [pk, name: "PK__CodeDef__4922449ECDD244C3"]
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -22,30 +22,6 @@ Enum "users_pg2_enum" {
|
|
|
22
22
|
"female2"
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
Enum "ecommerce_users_ejs_enum" {
|
|
26
|
-
"created2"
|
|
27
|
-
"running2"
|
|
28
|
-
"done2"
|
|
29
|
-
"failure2"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Enum "ecommerce_users_ejs2_enum" {
|
|
33
|
-
"created2"
|
|
34
|
-
"running2"
|
|
35
|
-
"done2"
|
|
36
|
-
"failure2"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
Enum "ecommerce_users_eg_enum" {
|
|
40
|
-
"male"
|
|
41
|
-
"female"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
Enum "ecommerce_users_eg2_enum" {
|
|
45
|
-
"male2"
|
|
46
|
-
"female2"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
25
|
Table "users" {
|
|
50
26
|
"id" int [pk]
|
|
51
27
|
"name" nvarchar(255)
|
|
@@ -72,13 +48,37 @@ Ref:"ecommerce"."users"."id" < "schemaA"."products"."name"
|
|
|
72
48
|
|
|
73
49
|
Ref:"users"."id" < "schemaA"."locations"."name"
|
|
74
50
|
|
|
51
|
+
Enum "ecommerce"."users_ejs_enum" {
|
|
52
|
+
"created2"
|
|
53
|
+
"running2"
|
|
54
|
+
"done2"
|
|
55
|
+
"failure2"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Enum "ecommerce"."users_ejs2_enum" {
|
|
59
|
+
"created2"
|
|
60
|
+
"running2"
|
|
61
|
+
"done2"
|
|
62
|
+
"failure2"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Enum "ecommerce"."users_eg_enum" {
|
|
66
|
+
"male"
|
|
67
|
+
"female"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
Enum "ecommerce"."users_eg2_enum" {
|
|
71
|
+
"male2"
|
|
72
|
+
"female2"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
75
|
Table "ecommerce"."users" {
|
|
76
76
|
"id" int [pk]
|
|
77
77
|
"name" nvarchar(255)
|
|
78
|
-
"ejs"
|
|
79
|
-
"ejs2"
|
|
80
|
-
"eg"
|
|
81
|
-
"eg2"
|
|
78
|
+
"ejs" ecommerce.users_ejs_enum [not null]
|
|
79
|
+
"ejs2" ecommerce.users_ejs2_enum [not null]
|
|
80
|
+
"eg" ecommerce.users_eg_enum [not null]
|
|
81
|
+
"eg2" ecommerce.users_eg2_enum [not null]
|
|
82
82
|
|
|
83
83
|
Indexes {
|
|
84
84
|
(name, ejs) [name: "idx_1"]
|
|
@@ -22,30 +22,6 @@ Enum "users_pg2_enum" {
|
|
|
22
22
|
"female2"
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
Enum "ecommerce_users_ejs_enum" {
|
|
26
|
-
"created2"
|
|
27
|
-
"running2"
|
|
28
|
-
"done2"
|
|
29
|
-
"failure2"
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Enum "ecommerce_users_ejs2_enum" {
|
|
33
|
-
"created2"
|
|
34
|
-
"running2"
|
|
35
|
-
"done2"
|
|
36
|
-
"failure2"
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
Enum "ecommerce_users_eg_enum" {
|
|
40
|
-
"male"
|
|
41
|
-
"female"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
Enum "ecommerce_users_eg2_enum" {
|
|
45
|
-
"male2"
|
|
46
|
-
"female2"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
25
|
Table "users" {
|
|
50
26
|
"id" int [pk]
|
|
51
27
|
"name" nvarchar(255)
|
|
@@ -72,13 +48,37 @@ Ref:"ecommerce"."users"."id" < "schemaA"."products"."name"
|
|
|
72
48
|
|
|
73
49
|
Ref:"users"."id" < "schemaA"."locations"."name"
|
|
74
50
|
|
|
51
|
+
Enum "ecommerce"."users_ejs_enum" {
|
|
52
|
+
"created2"
|
|
53
|
+
"running2"
|
|
54
|
+
"done2"
|
|
55
|
+
"failure2"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Enum "ecommerce"."users_ejs2_enum" {
|
|
59
|
+
"created2"
|
|
60
|
+
"running2"
|
|
61
|
+
"done2"
|
|
62
|
+
"failure2"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Enum "ecommerce"."users_eg_enum" {
|
|
66
|
+
"male"
|
|
67
|
+
"female"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
Enum "ecommerce"."users_eg2_enum" {
|
|
71
|
+
"male2"
|
|
72
|
+
"female2"
|
|
73
|
+
}
|
|
74
|
+
|
|
75
75
|
Table "ecommerce"."users" {
|
|
76
76
|
"id" int [pk]
|
|
77
77
|
"name" nvarchar(255)
|
|
78
|
-
"ejs"
|
|
79
|
-
"ejs2"
|
|
80
|
-
"eg"
|
|
81
|
-
"eg2"
|
|
78
|
+
"ejs" ecommerce.users_ejs_enum [not null]
|
|
79
|
+
"ejs2" ecommerce.users_ejs2_enum [not null]
|
|
80
|
+
"eg" ecommerce.users_eg_enum [not null]
|
|
81
|
+
"eg2" ecommerce.users_eg2_enum [not null]
|
|
82
82
|
|
|
83
83
|
Indexes {
|
|
84
84
|
(name, ejs) [name: "idx_1"]
|
|
@@ -19,3 +19,27 @@ undefined
|
|
|
19
19
|
2024-08-14T07:55:34.170Z
|
|
20
20
|
undefined
|
|
21
21
|
|
|
22
|
+
2025-04-07T19:53:05.751Z
|
|
23
|
+
undefined
|
|
24
|
+
|
|
25
|
+
2025-04-07T19:55:33.459Z
|
|
26
|
+
undefined
|
|
27
|
+
|
|
28
|
+
2025-04-07T20:00:47.773Z
|
|
29
|
+
undefined
|
|
30
|
+
|
|
31
|
+
2025-04-07T20:04:53.439Z
|
|
32
|
+
undefined
|
|
33
|
+
|
|
34
|
+
2025-04-07T20:05:29.644Z
|
|
35
|
+
undefined
|
|
36
|
+
|
|
37
|
+
2025-04-07T20:07:52.307Z
|
|
38
|
+
undefined
|
|
39
|
+
|
|
40
|
+
2025-04-07T20:10:09.528Z
|
|
41
|
+
undefined
|
|
42
|
+
|
|
43
|
+
2025-04-07T20:11:49.247Z
|
|
44
|
+
undefined
|
|
45
|
+
|
|
@@ -19,3 +19,27 @@ undefined
|
|
|
19
19
|
2024-08-14T07:55:34.526Z
|
|
20
20
|
undefined
|
|
21
21
|
|
|
22
|
+
2025-04-07T19:53:06.262Z
|
|
23
|
+
undefined
|
|
24
|
+
|
|
25
|
+
2025-04-07T19:55:33.981Z
|
|
26
|
+
undefined
|
|
27
|
+
|
|
28
|
+
2025-04-07T20:00:48.524Z
|
|
29
|
+
undefined
|
|
30
|
+
|
|
31
|
+
2025-04-07T20:04:54.259Z
|
|
32
|
+
undefined
|
|
33
|
+
|
|
34
|
+
2025-04-07T20:05:30.506Z
|
|
35
|
+
undefined
|
|
36
|
+
|
|
37
|
+
2025-04-07T20:07:53.066Z
|
|
38
|
+
undefined
|
|
39
|
+
|
|
40
|
+
2025-04-07T20:10:10.301Z
|
|
41
|
+
undefined
|
|
42
|
+
|
|
43
|
+
2025-04-07T20:11:50.008Z
|
|
44
|
+
undefined
|
|
45
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
ERROR:
|
|
2
|
-
You have a syntax error at "schema.sql" line
|
|
2
|
+
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")
|
|
3
3
|
|
|
4
4
|
A complete log can be found in:
|
|
@@ -19,3 +19,27 @@ undefined
|
|
|
19
19
|
2024-08-14T07:55:35.143Z
|
|
20
20
|
undefined
|
|
21
21
|
|
|
22
|
+
2025-04-07T19:53:06.915Z
|
|
23
|
+
undefined
|
|
24
|
+
|
|
25
|
+
2025-04-07T19:55:34.658Z
|
|
26
|
+
undefined
|
|
27
|
+
|
|
28
|
+
2025-04-07T20:00:49.180Z
|
|
29
|
+
undefined
|
|
30
|
+
|
|
31
|
+
2025-04-07T20:04:54.965Z
|
|
32
|
+
undefined
|
|
33
|
+
|
|
34
|
+
2025-04-07T20:05:31.383Z
|
|
35
|
+
undefined
|
|
36
|
+
|
|
37
|
+
2025-04-07T20:07:53.724Z
|
|
38
|
+
undefined
|
|
39
|
+
|
|
40
|
+
2025-04-07T20:10:10.993Z
|
|
41
|
+
undefined
|
|
42
|
+
|
|
43
|
+
2025-04-07T20:11:50.663Z
|
|
44
|
+
undefined
|
|
45
|
+
|
package/dbml-error.log
CHANGED
|
@@ -147,3 +147,12 @@ Error: ENOENT: no such file or directory, open '~/Users/huylm/code/work/dbml/pac
|
|
|
147
147
|
at connectToSnowflake (/Users/huylm/code/work/dbml/packages/dbml-connector/dist/connectors/snowflakeConnector.js:101:11)
|
|
148
148
|
at fetchSchemaJson (/Users/huylm/code/work/dbml/packages/dbml-connector/dist/connectors/snowflakeConnector.js:277:24)
|
|
149
149
|
|
|
150
|
+
2025-04-07T19:59:10.197Z
|
|
151
|
+
undefined
|
|
152
|
+
|
|
153
|
+
2025-04-08T05:02:45.801Z
|
|
154
|
+
undefined
|
|
155
|
+
|
|
156
|
+
2025-04-08T05:04:36.734Z
|
|
157
|
+
undefined
|
|
158
|
+
|
package/lib/cli/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function dbml2sql(args) {
|
|
|
28
28
|
}
|
|
29
29
|
function sql2dbml(args) {
|
|
30
30
|
_commander.default.version(_package.default.version);
|
|
31
|
-
_commander.default.usage('[options] <files...>').option('--mysql').option('--mysql-legacy').option('--postgres').option('--postgres-legacy').option('--mssql').option('--snowflake').option('-o, --out-file <pathspec>', 'compile all input files into a single files');
|
|
31
|
+
_commander.default.usage('[options] <files...>').option('--mysql').option('--mysql-legacy').option('--postgres').option('--postgres-legacy').option('--mssql').option('--mssql-legacy').option('--snowflake').option('-o, --out-file <pathspec>', 'compile all input files into a single files');
|
|
32
32
|
// .option('-d, --out-dir <pathspec>', 'compile an input directory of sql files into an output directory');
|
|
33
33
|
|
|
34
34
|
showHelp(args);
|
package/lib/cli/utils.js
CHANGED
|
@@ -24,7 +24,7 @@ function validateInputFilePaths(paths, validatePlugin) {
|
|
|
24
24
|
}
|
|
25
25
|
function getFormatOpt(opts) {
|
|
26
26
|
const formatOpts = Object.keys(opts).filter(opt => {
|
|
27
|
-
return ['postgres', 'mysql', 'mssql', 'postgresLegacy', 'mysqlLegacy', 'oracle', 'snowflake'].includes(opt);
|
|
27
|
+
return ['postgres', 'mysql', 'mssql', 'postgresLegacy', 'mysqlLegacy', 'mssqlLegacy', 'oracle', 'snowflake'].includes(opt);
|
|
28
28
|
});
|
|
29
29
|
let format = 'postgres';
|
|
30
30
|
let cnt = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbml/cli",
|
|
3
|
-
"version": "3.12.0
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@babel/cli": "^7.21.0",
|
|
29
|
-
"@dbml/connector": "^3.12.0
|
|
30
|
-
"@dbml/core": "^3.12.0
|
|
29
|
+
"@dbml/connector": "^3.12.0",
|
|
30
|
+
"@dbml/core": "^3.12.0",
|
|
31
31
|
"bluebird": "^3.5.5",
|
|
32
32
|
"chalk": "^2.4.2",
|
|
33
33
|
"commander": "^2.20.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"^.+\\.js$": "babel-jest"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "e14cab048ba2c38acb622e780bea160a115a03d5",
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=18"
|
|
61
61
|
}
|
package/src/cli/index.js
CHANGED
|
@@ -37,6 +37,7 @@ function sql2dbml (args) {
|
|
|
37
37
|
.option('--postgres')
|
|
38
38
|
.option('--postgres-legacy')
|
|
39
39
|
.option('--mssql')
|
|
40
|
+
.option('--mssql-legacy')
|
|
40
41
|
.option('--snowflake')
|
|
41
42
|
.option('-o, --out-file <pathspec>', 'compile all input files into a single files');
|
|
42
43
|
// .option('-d, --out-dir <pathspec>', 'compile an input directory of sql files into an output directory');
|
package/src/cli/utils.js
CHANGED
|
@@ -16,7 +16,7 @@ function validateInputFilePaths (paths, validatePlugin) {
|
|
|
16
16
|
|
|
17
17
|
function getFormatOpt (opts) {
|
|
18
18
|
const formatOpts = Object.keys(opts).filter((opt) => {
|
|
19
|
-
return ['postgres', 'mysql', 'mssql', 'postgresLegacy', 'mysqlLegacy', 'oracle', 'snowflake'].includes(opt);
|
|
19
|
+
return ['postgres', 'mysql', 'mssql', 'postgresLegacy', 'mysqlLegacy', 'mssqlLegacy', 'oracle', 'snowflake'].includes(opt);
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
let format = 'postgres';
|