@dbml/cli 3.13.9-alpha.0 → 3.14.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__/db2dbml/mssql/dbml-error.log +636 -0
- package/__test__/db2dbml/mssql/out-files/schema.dbml +242 -0
- package/__test__/db2dbml/mysql/dbml-error.log +570 -0
- package/__test__/db2dbml/mysql/out-files/schema.dbml +180 -0
- package/__test__/db2dbml/postgres/dbml-error.log +375 -0
- package/__test__/db2dbml/postgres/out-files/schema.dbml +180 -0
- package/__test__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
- package/__test__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
- package/__test__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
- package/__test__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +1 -1
- package/__test__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +3 -3
- package/__test__/dbml2sql/syntax-error/dbml-error.log +12 -1515
- package/__test__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +3 -3
- package/__test__/sql2dbml/filename --snowflake stdout/dbml-error.log +0 -0
- package/__test__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +28 -28
- package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +0 -52
- package/__test__/sql2dbml/syntax-error/dbml-error.log +29 -1532
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +32 -1593
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +32 -1593
- package/dbml-error.log +277 -329
- package/lib/cli/index.js +17 -8
- package/package.json +4 -4
- package/snowflake.log +129 -0
- package/src/cli/index.js +18 -9
- package/yarn-error.log +0 -87
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Enum "dbo"."chk_status_status" {
|
|
2
|
+
"cancelled"
|
|
3
|
+
"delivered"
|
|
4
|
+
"shipped"
|
|
5
|
+
"processing"
|
|
6
|
+
"pending"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
Enum "dbo"."chk_gender_gender" {
|
|
10
|
+
"Other"
|
|
11
|
+
"Female"
|
|
12
|
+
"Male"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Enum "dbo"."CK_Address_Valid_AddressID_AddressFormatID" {
|
|
16
|
+
"176029FA-D6D3-49E1-A48C-000000000002"
|
|
17
|
+
"176029FA-D6D3-49E1-A48C-000000000001"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Enum "dbo"."CK_Address_Valid2_A1" {
|
|
21
|
+
"333"
|
|
22
|
+
"2222"
|
|
23
|
+
"1111"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Enum "dbo"."CK_Address_Valid2_A2_A3" {
|
|
27
|
+
"2222"
|
|
28
|
+
"1111"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Enum "dbo"."CK_Address_Valid2_A4" {
|
|
32
|
+
"3333"
|
|
33
|
+
"2222"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Table "dbo"."users" {
|
|
37
|
+
"user_id" int(10) [pk, not null, increment]
|
|
38
|
+
"username" varchar(50) [unique, not null]
|
|
39
|
+
"email" varchar(100) [unique, not null]
|
|
40
|
+
"password_hash" varchar(255) [not null]
|
|
41
|
+
"first_name" varchar(50)
|
|
42
|
+
"last_name" varchar(50)
|
|
43
|
+
"full_name" varchar(100)
|
|
44
|
+
"full_name_lower" varchar(100)
|
|
45
|
+
"date_of_birth" date
|
|
46
|
+
"created_at" datetime2 [default: `getdate()`]
|
|
47
|
+
"last_login" datetime2
|
|
48
|
+
"is_active" bit [default: 1]
|
|
49
|
+
|
|
50
|
+
Indexes {
|
|
51
|
+
email [type: nonclustered, name: "idx_users_email"]
|
|
52
|
+
full_name [type: nonclustered, name: "idx_users_full_name"]
|
|
53
|
+
(is_active, full_name_lower) [type: nonclustered, name: "idx_users_is_active_full_name"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Table "dbo"."products" {
|
|
58
|
+
"product_id" int(10) [pk, not null, increment]
|
|
59
|
+
"name" varchar(100) [not null]
|
|
60
|
+
"description" text
|
|
61
|
+
"price" decimal(10,2) [not null]
|
|
62
|
+
"stock_quantity" int(10) [not null, default: 0]
|
|
63
|
+
"category" varchar(50)
|
|
64
|
+
"created_at" datetime2 [default: `getdate()`]
|
|
65
|
+
"updated_at" datetime2 [default: `getdate()`]
|
|
66
|
+
"is_available" bit [default: 1]
|
|
67
|
+
|
|
68
|
+
Indexes {
|
|
69
|
+
category [type: nonclustered, name: "idx_products_category"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
Table "dbo"."orders" {
|
|
74
|
+
"order_id" int(10) [pk, not null, increment]
|
|
75
|
+
"user_id" int(10) [not null]
|
|
76
|
+
"order_date" datetime2 [default: `getdate()`]
|
|
77
|
+
"total_amount" decimal(12,2) [not null]
|
|
78
|
+
"status" dbo.chk_status_status [default: 'pending']
|
|
79
|
+
"shipping_address" text [not null]
|
|
80
|
+
"billing_address" text [not null]
|
|
81
|
+
|
|
82
|
+
Indexes {
|
|
83
|
+
(user_id, order_date) [type: nonclustered, name: "idx_orders_user_date"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Table "dbo"."order_items" {
|
|
88
|
+
"order_item_id" int(10) [pk, not null, increment]
|
|
89
|
+
"order_id" int(10) [unique, not null]
|
|
90
|
+
"product_id" int(10) [unique, not null]
|
|
91
|
+
"quantity" int(10) [not null]
|
|
92
|
+
"unit_price" decimal(10,2) [not null]
|
|
93
|
+
|
|
94
|
+
Indexes {
|
|
95
|
+
(order_id, product_id) [type: nonclustered, name: "idx_order_items_order_product"]
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
Table "dbo"."StringTypes" {
|
|
100
|
+
"Id" int(10) [pk, not null, increment]
|
|
101
|
+
"CharField" char(10) [default: 'N/A']
|
|
102
|
+
"VarcharField" varchar(50) [default: '{"default_key": "default_value"}']
|
|
103
|
+
"VarcharMaxField" varchar(MAX) [default: 'N/A']
|
|
104
|
+
"TextField" text [default: 'N/A']
|
|
105
|
+
"NCharField" nchar(10) [default: `N'N/A'`]
|
|
106
|
+
"NVarCharField" nvarchar(50) [default: `N'N/A'`]
|
|
107
|
+
"NVarCharMaxField" nvarchar(MAX) [default: `N'N/A'`]
|
|
108
|
+
"NTextField" ntext [default: `N'N/A'`]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Table "dbo"."NumberTypes" {
|
|
112
|
+
"ID" int(10) [pk, not null, increment]
|
|
113
|
+
"TINYINTCol" tinyint(3) [default: 0]
|
|
114
|
+
"SMALLINTCol" smallint(5) [default: 0]
|
|
115
|
+
"INTCol" int(10) [default: 0]
|
|
116
|
+
"BIGINTCol" bigint(19) [default: 0]
|
|
117
|
+
"DECIMALCol" decimal(10,2) [default: 0.00]
|
|
118
|
+
"NUMERICCol" numeric(10,2) [default: 0.00]
|
|
119
|
+
"FLOATCol" float(53) [default: 0.0]
|
|
120
|
+
"REALCol" real(24) [default: 0.0]
|
|
121
|
+
"BITCol" bit [default: 0]
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Table "dbo"."NumberTypesNoDefault" {
|
|
125
|
+
"ID" int(10) [pk, not null, increment]
|
|
126
|
+
"TINYINTCol" tinyint(3)
|
|
127
|
+
"SMALLINTCol" smallint(5)
|
|
128
|
+
"INTCol" int(10)
|
|
129
|
+
"BIGINTCol" bigint(19)
|
|
130
|
+
"DECIMALCol" decimal(10,2)
|
|
131
|
+
"NUMERICCol" numeric(10,2)
|
|
132
|
+
"FLOATCol" float(53)
|
|
133
|
+
"REALCol" real(24)
|
|
134
|
+
"BITCol" bit
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
Table "dbo"."DatetimeTypes" {
|
|
138
|
+
"ID" int(10) [pk, not null, increment]
|
|
139
|
+
"DATECol" date [default: `getdate()`]
|
|
140
|
+
"TIMECol" time [default: `CONVERT([time],getdate())`]
|
|
141
|
+
"DATETIMECol" datetime [default: `getdate()`]
|
|
142
|
+
"DATETIME2Col" datetime2 [default: `sysdatetime()`]
|
|
143
|
+
"SMALLDATETIMECol" smalldatetime [default: `getdate()`]
|
|
144
|
+
"ROWVERSIONCol" timestamp [not null]
|
|
145
|
+
"DATETIMEOFFSETCol" datetimeoffset [default: `sysdatetimeoffset()`]
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
Table "dbo"."ObjectTypes" {
|
|
149
|
+
"Id" int(10) [pk, not null, increment]
|
|
150
|
+
"XmlField" xml [default: '''<Books>
|
|
151
|
+
<Book>
|
|
152
|
+
<Title>The Great Gatsby</Title>
|
|
153
|
+
<Author>F. Scott Fitzgerald</Author>
|
|
154
|
+
<Year>1925</Year>
|
|
155
|
+
<Price>10.99</Price>
|
|
156
|
+
<Publisher>Scribner</Publisher>
|
|
157
|
+
<Location>New York</Location>
|
|
158
|
+
<Genre>Fiction</Genre>
|
|
159
|
+
<Subgenre>Classic</Subgenre>
|
|
160
|
+
</Book>
|
|
161
|
+
<Book>
|
|
162
|
+
<Title>1984</Title>
|
|
163
|
+
<Author>George Orwell</Author>
|
|
164
|
+
<Year>1949</Year>
|
|
165
|
+
<Price>8.99</Price>
|
|
166
|
+
<Publisher>Secker & Warburg</Publisher>
|
|
167
|
+
<Location>London</Location>
|
|
168
|
+
<Genre>Dystopian</Genre>
|
|
169
|
+
<Subgenre>Political Fiction</Subgenre>
|
|
170
|
+
</Book>
|
|
171
|
+
</Books>''']
|
|
172
|
+
"JsonField" nvarchar(MAX) [default: `N'{"defaultKey": "defaultValue", "status": "active", "count": 0}'`]
|
|
173
|
+
"BinaryField" binary(50) [default: `0x00`]
|
|
174
|
+
"VarBinaryField" varbinary(50) [default: `0x00`]
|
|
175
|
+
"VarBinaryMaxField" varbinary(MAX) [default: `0x00`]
|
|
176
|
+
"ImageField" image [default: `0x00`]
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
Table "dbo"."gender_reference" {
|
|
180
|
+
"value" nvarchar(10) [pk, not null]
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
Table "dbo"."user_define_data_types" {
|
|
184
|
+
"id" int(10) [pk, not null, increment]
|
|
185
|
+
"name" nvarchar(50)
|
|
186
|
+
"gender" dbo.chk_gender_gender
|
|
187
|
+
"age_start" int(10)
|
|
188
|
+
"age_end" int(10)
|
|
189
|
+
"height" float(53)
|
|
190
|
+
"weight" float(53)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
Table "dbo"."table_with_comments" {
|
|
194
|
+
"id" int(10) [pk, not null, increment, note: 'Unique identifier for each item.']
|
|
195
|
+
"name" varchar(100) [note: 'Name of the item.']
|
|
196
|
+
"description" text [note: '''Item\'s description''']
|
|
197
|
+
"created_at" datetime2 [default: `getdate()`, note: 'Timestamp when the item was created.']
|
|
198
|
+
Note: 'This table stores information about various items.'
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
Table "dbo"."Authors" {
|
|
202
|
+
"AuthorID" int(10) [pk, not null]
|
|
203
|
+
"NationalityID" int(10) [pk, not null]
|
|
204
|
+
"AuthorName" nvarchar(100) [unique]
|
|
205
|
+
"BirthYear" int(10) [unique]
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
Table "dbo"."Books" {
|
|
209
|
+
"BookID" int(10) [pk, not null]
|
|
210
|
+
"AuthorID" int(10) [pk, not null]
|
|
211
|
+
"NationalityID" int(10)
|
|
212
|
+
"ISBN" nvarchar(20) [unique]
|
|
213
|
+
"Title" nvarchar(200)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
Table "dbo"."AddressInfo" {
|
|
217
|
+
"AddressID" dbo.CK_Address_Valid_AddressID_AddressFormatID [not null]
|
|
218
|
+
"AddressFormatID" dbo.CK_Address_Valid_AddressID_AddressFormatID [not null]
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
Table "dbo"."AddressInfo2" {
|
|
222
|
+
"A1" dbo.CK_Address_Valid2_A1 [not null]
|
|
223
|
+
"A2" dbo.CK_Address_Valid2_A2_A3 [not null]
|
|
224
|
+
"A3" dbo.CK_Address_Valid2_A2_A3 [not null]
|
|
225
|
+
"A4" dbo.CK_Address_Valid2_A4 [not null]
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
Table "dbo"."TestDescriptionTable" {
|
|
229
|
+
"Id" int(10) [note: 'Primary key identifier.']
|
|
230
|
+
"Name" nvarchar(100) [note: 'Name of the entity.']
|
|
231
|
+
Note: 'This is the custom comment name on table.'
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
Ref "FK_AuthorNationality":"dbo"."Authors".("AuthorID", "NationalityID") < "dbo"."Books".("AuthorID", "NationalityID")
|
|
235
|
+
|
|
236
|
+
Ref "fk_product":"dbo"."products"."product_id" < "dbo"."order_items"."product_id" [update: cascade]
|
|
237
|
+
|
|
238
|
+
Ref "fk_order":"dbo"."orders"."order_id" < "dbo"."order_items"."order_id" [update: cascade, delete: cascade]
|
|
239
|
+
|
|
240
|
+
Ref "fk_user":"dbo"."users"."user_id" < "dbo"."orders"."user_id" [update: cascade, delete: cascade]
|
|
241
|
+
|
|
242
|
+
Ref "fk_gender":"dbo"."gender_reference"."value" < "dbo"."user_define_data_types"."gender"
|