@dbml/cli 10.4.0-alpha.1 → 10.4.0-alpha.10

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.
Files changed (101) hide show
  1. package/__tests__/dbml2sql/multifile --postgres stdout/in-files/main.dbml +2 -0
  2. package/__tests__/dbml2sql/multifile --postgres stdout/in-files/sub/orders.dbml +6 -0
  3. package/__tests__/dbml2sql/multifile --postgres stdout/in-files/types.dbml +4 -0
  4. package/__tests__/dbml2sql/multifile --postgres stdout/options.json +6 -0
  5. package/__tests__/dbml2sql/multifile --postgres stdout/stdout.txt +12 -0
  6. package/__tests__/dbml2sql/multifile error entry-syntax-error/dbml-error.log +1 -21
  7. package/__tests__/dbml2sql/multifile error import-not-found/dbml-error.log +441 -5137
  8. package/__tests__/dbml2sql/multifile error imported-syntax-error/dbml-error.log +1 -21
  9. package/__tests__/dbml2sql/multifile error transitive-use-not-visible/dbml-error.log +1 -17
  10. package/__tests__/windows/multifile-backslash/in-files/main.dbml +2 -0
  11. package/__tests__/windows/multifile-backslash/in-files/sub/orders.dbml +6 -0
  12. package/__tests__/windows/multifile-backslash/in-files/types.dbml +4 -0
  13. package/__tests__/windows/multifile-backslash/options.json +6 -0
  14. package/__tests__/windows/multifile-backslash/stdout.txt +12 -0
  15. package/__tests__/windows/multifile-relative/in-files/main.dbml +2 -0
  16. package/__tests__/windows/multifile-relative/in-files/sub/orders.dbml +6 -0
  17. package/__tests__/windows/multifile-relative/in-files/types.dbml +4 -0
  18. package/__tests__/windows/multifile-relative/options.json +6 -0
  19. package/__tests__/windows/multifile-relative/stdout.txt +12 -0
  20. package/__tests__/windows.test.ts +34 -0
  21. package/lib/index.js +93 -32
  22. package/package.json +6 -6
  23. package/src/NodeProjectLayout.ts +9 -1
  24. package/src/cli/import.ts +4 -5
  25. package/src/cli/utils.ts +4 -3
  26. package/__tests__/db2dbml/mssql/dbml-error.log +0 -55
  27. package/__tests__/db2dbml/mysql/dbml-error.log +0 -15
  28. package/__tests__/db2dbml/oracle/dbml-error.log +0 -70
  29. package/__tests__/db2dbml/postgres/dbml-error.log +0 -35
  30. package/__tests__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +0 -65
  31. package/__tests__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +0 -61
  32. package/__tests__/dbml2sql/filename --oracle stdout/dbml-error.log +0 -0
  33. package/__tests__/dbml2sql/filename --out-file/dbml-error.log +0 -0
  34. package/__tests__/dbml2sql/filename --out-file/out-files/schema.sql +0 -77
  35. package/__tests__/dbml2sql/filename --postgres --out-file/dbml-error.log +0 -0
  36. package/__tests__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +0 -77
  37. package/__tests__/dbml2sql/filename --postgres stdout/dbml-error.log +0 -0
  38. package/__tests__/dbml2sql/filename stdout/dbml-error.log +0 -0
  39. package/__tests__/dbml2sql/filenames --mysql --out-file/dbml-error.log +0 -0
  40. package/__tests__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +0 -172
  41. package/__tests__/dbml2sql/filenames --mysql stdout/dbml-error.log +0 -0
  42. package/__tests__/dbml2sql/filenames --oracle --out-file/dbml-error.log +0 -0
  43. package/__tests__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +0 -172
  44. package/__tests__/dbml2sql/filenames --oracle stdout/dbml-error.log +0 -0
  45. package/__tests__/dbml2sql/filenames --out-file/dbml-error.log +0 -0
  46. package/__tests__/dbml2sql/filenames --out-file/out-files/schema.sql +0 -172
  47. package/__tests__/dbml2sql/filenames --postgres --out-file/dbml-error.log +0 -0
  48. package/__tests__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +0 -172
  49. package/__tests__/dbml2sql/filenames --postgres stdout/dbml-error.log +0 -0
  50. package/__tests__/dbml2sql/filenames stdout/dbml-error.log +0 -0
  51. package/__tests__/dbml2sql/multiple_schema_mssql/dbml-error.log +0 -0
  52. package/__tests__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +0 -62
  53. package/__tests__/dbml2sql/multiple_schema_mysql/dbml-error.log +0 -0
  54. package/__tests__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +0 -50
  55. package/__tests__/dbml2sql/multiple_schema_oracle/dbml-error.log +0 -0
  56. package/__tests__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +0 -88
  57. package/__tests__/dbml2sql/multiple_schema_pg/dbml-error.log +0 -0
  58. package/__tests__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +0 -67
  59. package/__tests__/dbml2sql/single file stdout/dbml-error.log +0 -0
  60. package/__tests__/dbml2sql/syntax-error/dbml-error.log +0 -25
  61. package/__tests__/sql2dbml/custom-error-alter-table-column-not-found --oracle/dbml-error.log +0 -20
  62. package/__tests__/sql2dbml/custom-error-alter-table-table-not-found --oracle/dbml-error.log +0 -20
  63. package/__tests__/sql2dbml/custom-error-column-comment-column-not-found --oracle/dbml-error.log +0 -20
  64. package/__tests__/sql2dbml/custom-error-column-comment-table-not-found --oracle/dbml-error.log +0 -20
  65. package/__tests__/sql2dbml/custom-error-create-index-table-not-found --oracle/dbml-error.log +0 -20
  66. package/__tests__/sql2dbml/custom-error-table-comment-table-not-found --oracle/dbml-error.log +0 -20
  67. package/__tests__/sql2dbml/filename --mssql --out-file/dbml-error.log +0 -0
  68. package/__tests__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +0 -25
  69. package/__tests__/sql2dbml/filename --mysql --out-file/dbml-error.log +0 -0
  70. package/__tests__/sql2dbml/filename --mysql --out-file/out-files/schema.dbml +0 -74
  71. package/__tests__/sql2dbml/filename --mysql stdout/dbml-error.log +0 -0
  72. package/__tests__/sql2dbml/filename --oracle --out-file/dbml-error.log +0 -0
  73. package/__tests__/sql2dbml/filename --oracle --out-file/out-files/schema.dbml +0 -83
  74. package/__tests__/sql2dbml/filename --out-file/dbml-error.log +0 -0
  75. package/__tests__/sql2dbml/filename --out-file/out-files/schema.dbml +0 -74
  76. package/__tests__/sql2dbml/filename --postgres --out-file/dbml-error.log +0 -0
  77. package/__tests__/sql2dbml/filename --postgres --out-file/out-files/schema.dbml +0 -74
  78. package/__tests__/sql2dbml/filename --postgres stdout/dbml-error.log +0 -0
  79. package/__tests__/sql2dbml/filename --snowflake stdout/dbml-error.log +0 -0
  80. package/__tests__/sql2dbml/filename stdout/dbml-error.log +0 -0
  81. package/__tests__/sql2dbml/filenames --mysql --out-file/dbml-error.log +0 -0
  82. package/__tests__/sql2dbml/filenames --mysql --out-file/out-files/schema.dbml +0 -170
  83. package/__tests__/sql2dbml/filenames --mysql stdout/dbml-error.log +0 -0
  84. package/__tests__/sql2dbml/filenames --out-file/dbml-error.log +0 -0
  85. package/__tests__/sql2dbml/filenames --out-file/out-files/schema.dbml +0 -170
  86. package/__tests__/sql2dbml/filenames --postgres --out-file/dbml-error.log +0 -0
  87. package/__tests__/sql2dbml/filenames --postgres --out-file/out-files/schema.dbml +0 -170
  88. package/__tests__/sql2dbml/filenames --postgres stdout/dbml-error.log +0 -0
  89. package/__tests__/sql2dbml/filenames stdout/dbml-error.log +0 -0
  90. package/__tests__/sql2dbml/multiple_schema_mssql/dbml-error.log +0 -0
  91. package/__tests__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +0 -58
  92. package/__tests__/sql2dbml/multiple_schema_mysql/dbml-error.log +0 -0
  93. package/__tests__/sql2dbml/multiple_schema_mysql/out-files/multiple_schema.out.dbml +0 -136
  94. package/__tests__/sql2dbml/multiple_schema_pg/dbml-error.log +0 -0
  95. package/__tests__/sql2dbml/multiple_schema_pg/out-files/multiple_schema.out.dbml +0 -101
  96. package/__tests__/sql2dbml/syntax-error/dbml-error.log +0 -20
  97. package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +0 -20
  98. package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +0 -20
  99. /package/__tests__/dbml2sql/{filename --mysql --out-file → multifile --postgres stdout}/dbml-error.log +0 -0
  100. /package/__tests__/{dbml2sql/filename --mysql stdout → windows/multifile-relative}/dbml-error.log +0 -0
  101. /package/{__tests__/dbml2sql/filename --oracle --out-file/dbml-error.log → dbml-error.log} +0 -0
@@ -1,136 +0,0 @@
1
- Enum "users_pjs_enum" {
2
- "created2"
3
- "running2"
4
- "done2"
5
- "failure2"
6
- }
7
-
8
- Enum "users_pjs2_enum" {
9
- "created2"
10
- "running2"
11
- "done2"
12
- "failure2"
13
- }
14
-
15
- Enum "users_pg_enum" {
16
- "male"
17
- "female"
18
- }
19
-
20
- Enum "users_pg2_enum" {
21
- "male2"
22
- "female2"
23
- }
24
-
25
- Table "users" {
26
- "id" int [pk]
27
- "name" varchar(255)
28
- "pjs" users_pjs_enum
29
- "pjs2" users_pjs2_enum
30
- "pg" users_pg_enum
31
- "pg2" users_pg2_enum
32
- }
33
-
34
- Table "products" {
35
- "id" int [pk]
36
- "name" varchar(255) [note: 'Product name']
37
- }
38
-
39
- Table "orders" {
40
- "id1" int
41
- "id2" int
42
- "pid" int
43
- "name" varchar(255)
44
- "name2" varchar(255)
45
-
46
- Indexes {
47
- (id1, id2) [pk, type: hash, name: "CPK_1"]
48
- (name, name2) [type: btree, unique, name: "I_UNIQUE_1"]
49
- (id1, id2) [type: hash, name: "INDEX_2"]
50
- }
51
- Note: 'this is table orders'
52
- }
53
-
54
- Table "orders2" {
55
- "id1" int
56
- "id2" int
57
- "pid" int
58
-
59
- Indexes {
60
- (id1, id2) [pk, name: "testCPK"]
61
- }
62
- }
63
-
64
- Table "orders4" {
65
- "id1" int
66
- "id2" int
67
-
68
- Indexes {
69
- (id1, id2) [pk, name: "PK_orders4_id1_id2"]
70
- }
71
- }
72
-
73
- Ref "FK_1":"schemaA"."locations"."id" < "schemaA"."products"."lid" [delete: cascade]
74
-
75
- Ref:"schemaA"."products"."id" < "orders"."pid"
76
-
77
- Ref:"schemaA"."products"."id" < "orders2"."pid"
78
-
79
- Ref "CFK_1":"orders".("id1", "id2") < "orders2".("id1", "id2") [update: set null, delete: cascade]
80
-
81
- Ref:"users"."id" < "ecommerce"."users"."id"
82
-
83
- Ref "name_optional":"users"."name" < "ecommerce"."users"."id"
84
-
85
- Ref:"ecommerce"."users"."id" < "schemaA"."products"."name"
86
-
87
- Ref:"users"."id" < "schemaA"."locations"."name"
88
-
89
- Enum "ecommerce"."users_ejs_enum" {
90
- "created2"
91
- "running2"
92
- "done2"
93
- "failure2"
94
- }
95
-
96
- Enum "ecommerce"."users_ejs2_enum" {
97
- "created2"
98
- "running2"
99
- "done2"
100
- "failure2"
101
- }
102
-
103
- Enum "ecommerce"."users_eg_enum" {
104
- "male"
105
- "female"
106
- }
107
-
108
- Enum "ecommerce"."users_eg2_enum" {
109
- "male2"
110
- "female2"
111
- }
112
-
113
- Table "ecommerce"."users" {
114
- "id" int [pk]
115
- "name" varchar(255)
116
- "ejs" ecommerce.users_ejs_enum
117
- "ejs2" ecommerce.users_ejs2_enum
118
- "eg" ecommerce.users_eg_enum
119
- "eg2" ecommerce.users_eg2_enum
120
- }
121
-
122
- Table "schemaA"."products" {
123
- "id" int [pk]
124
- "name" varchar(255) [note: 'Sample field comment on multiples schema']
125
- "lid" int
126
- }
127
-
128
- Table "schemaA"."locations" {
129
- "id" int [pk]
130
- "name" varchar(255)
131
- }
132
-
133
- Table "schemaB"."orders3" {
134
- "id1" int [pk]
135
- "id2" int
136
- }
@@ -1,101 +0,0 @@
1
- Enum "job_status" {
2
- "created2"
3
- "running2"
4
- "done2"
5
- "failure2"
6
- }
7
-
8
- Enum "gender" {
9
- "male2"
10
- "female2"
11
- }
12
-
13
- Table "users" {
14
- "id" int [pk]
15
- "name" varchar
16
- "pjs" job_status
17
- "pjs2" job_status
18
- "pg" schemaB.gender
19
- "pg2" gender
20
- "country_code" int
21
- Note: 'Sample note on table users'
22
- }
23
-
24
- Table "countries" {
25
- "code" int [pk]
26
- "name" varchar
27
- "continent_name" varchar
28
- }
29
-
30
- Table "products" {
31
- "id" int [pk]
32
- "name" varchar [note: 'Product name of table products in public schema']
33
-
34
- Indexes {
35
- id [type: hash, unique]
36
- }
37
- }
38
-
39
- Table "booking_reference" {
40
- "reference_id" NVARCHAR(10) [not null]
41
- "cust_id" NUMBER(10) [not null]
42
- "status" NVARCHAR(1) [not null]
43
-
44
- Indexes {
45
- (reference_id, cust_id) [pk]
46
- }
47
- }
48
-
49
- Table "br_flight" {
50
- "reference_id" NVARCHAR(10) [not null]
51
- "cust_id" NUMBER(10) [not null]
52
- "flight_id" NVARCHAR(10) [not null]
53
-
54
- Indexes {
55
- (reference_id, flight_id) [pk]
56
- }
57
- }
58
-
59
- Ref "fk_1":"schemaA"."locations"."id" < "schemaA"."products"."lid"
60
-
61
- Ref:"users"."id" < "ecommerce"."users"."id"
62
-
63
- Ref "name_optional":"users"."name" < "ecommerce"."users"."id"
64
-
65
- Ref:"ecommerce"."users"."id" < "schemaA"."products"."name"
66
-
67
- Ref:"users"."id" < "schemaA"."locations"."name"
68
-
69
- Ref "fk_composite":"booking_reference".("reference_id", "cust_id") < "br_flight".("reference_id", "cust_id")
70
-
71
- Ref "fk_country_code":"countries"."code" < "users"."country_code"
72
-
73
- Enum "schemaB"."gender" {
74
- "male"
75
- "female"
76
- }
77
-
78
- Table "ecommerce"."users" {
79
- "id" int [pk]
80
- "name" varchar
81
- "ejs" job_status
82
- "ejs2" job_status
83
- "eg" schemaB.gender
84
- "eg2" gender
85
- }
86
-
87
- Table "schemaA"."products" {
88
- "id" int [pk]
89
- "name" varchar [note: 'Product name of schemaA']
90
- "lid" int
91
-
92
- Indexes {
93
- (id, name) [name: "product_status"]
94
- }
95
- }
96
-
97
- Table "schemaA"."locations" {
98
- "id" int [pk]
99
- "name" varchar
100
- Note: 'This is a note in table "locations"'
101
- }
@@ -1,20 +0,0 @@
1
- 2026-06-15T10:58:15.657Z
2
-
3
- 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`'
4
-
5
- 2026-06-15T10:59:18.327Z
6
-
7
- 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`'
8
-
9
- 2026-07-22T11:04:05.189Z
10
-
11
- 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`'
12
-
13
- 2026-07-22T11:07:37.957Z
14
-
15
- 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`'
16
-
17
- 2026-07-22T11:10:19.754Z
18
-
19
- 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`'
20
-
@@ -1,20 +0,0 @@
1
- 2026-06-15T10:58:16.414Z
2
-
3
- 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")
4
-
5
- 2026-06-15T10:59:19.055Z
6
-
7
- 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")
8
-
9
- 2026-07-22T11:04:05.946Z
10
-
11
- 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")
12
-
13
- 2026-07-22T11:07:38.718Z
14
-
15
- 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")
16
-
17
- 2026-07-22T11:10:20.550Z
18
-
19
- 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")
20
-
@@ -1,20 +0,0 @@
1
- 2026-06-15T10:58:17.125Z
2
-
3
- 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")
4
-
5
- 2026-06-15T10:59:19.725Z
6
-
7
- 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")
8
-
9
- 2026-07-22T11:04:06.639Z
10
-
11
- 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")
12
-
13
- 2026-07-22T11:07:39.465Z
14
-
15
- 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")
16
-
17
- 2026-07-22T11:10:21.392Z
18
-
19
- 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")
20
-