@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,180 @@
|
|
|
1
|
+
Enum "dbml_test"."enum_type1" {
|
|
2
|
+
"value1"
|
|
3
|
+
"value2"
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
Enum "dbml_test"."enum_type3" {
|
|
7
|
+
"value4"
|
|
8
|
+
"value5"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
Table "dbml_test"."table1" {
|
|
12
|
+
"id" int4 [pk, not null, increment]
|
|
13
|
+
"status" dbml_test.enum_type1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Table "dbml_test"."table3" {
|
|
17
|
+
"id" int4 [pk, not null, increment]
|
|
18
|
+
"status" dbml_test.enum_type3
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Enum "enum_type1" {
|
|
22
|
+
"value1"
|
|
23
|
+
"value2"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Enum "enum_type2" {
|
|
27
|
+
"value1"
|
|
28
|
+
"value3"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Enum "gender_type" {
|
|
32
|
+
"Male"
|
|
33
|
+
"Female"
|
|
34
|
+
"Other"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Table "users" {
|
|
38
|
+
"user_id" int4 [pk, not null, increment]
|
|
39
|
+
"username" varchar(50) [unique, not null]
|
|
40
|
+
"email" varchar(100) [unique, not null]
|
|
41
|
+
"password_hash" varchar(255) [not null]
|
|
42
|
+
"first_name" varchar(50)
|
|
43
|
+
"last_name" varchar(50)
|
|
44
|
+
"full_name" varchar(100)
|
|
45
|
+
"date_of_birth" date
|
|
46
|
+
"created_at" timestamptz [default: `CURRENT_TIMESTAMP`]
|
|
47
|
+
"last_login" timestamptz
|
|
48
|
+
"is_active" bool [default: true]
|
|
49
|
+
|
|
50
|
+
Indexes {
|
|
51
|
+
full_name [type: btree, name: "User Name"]
|
|
52
|
+
email [type: btree, name: "idx_users_email"]
|
|
53
|
+
(is_active, `lower((full_name)::text)`) [type: btree, name: "users_is_active_lower_idx"]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Table "products" {
|
|
58
|
+
"product_id" int4 [pk, not null, increment]
|
|
59
|
+
"name" varchar(100) [not null]
|
|
60
|
+
"description" text
|
|
61
|
+
"price" numeric(10,2) [not null]
|
|
62
|
+
"stock_quantity" int4 [not null, default: 0]
|
|
63
|
+
"category" varchar(50)
|
|
64
|
+
"created_at" timestamptz [default: `CURRENT_TIMESTAMP`]
|
|
65
|
+
"updated_at" timestamptz [default: `CURRENT_TIMESTAMP`]
|
|
66
|
+
"is_available" bool [default: true]
|
|
67
|
+
|
|
68
|
+
Indexes {
|
|
69
|
+
category [type: btree, name: "idx_products_category"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
Table "orders" {
|
|
74
|
+
"order_id" int4 [pk, not null, increment]
|
|
75
|
+
"user_id" int4 [not null]
|
|
76
|
+
"order_date" timestamptz [default: `CURRENT_TIMESTAMP`]
|
|
77
|
+
"total_amount" numeric(12,2) [not null]
|
|
78
|
+
"status" varchar(20) [default: 'pending']
|
|
79
|
+
"shipping_address" text [not null]
|
|
80
|
+
"billing_address" text [not null]
|
|
81
|
+
|
|
82
|
+
Indexes {
|
|
83
|
+
(user_id, order_date) [type: btree, name: "idx_orders_user_date"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Table "order_items" {
|
|
88
|
+
"order_item_id" int4 [pk, not null, increment]
|
|
89
|
+
"order_id" int4 [not null]
|
|
90
|
+
"product_id" int4 [not null]
|
|
91
|
+
"quantity" int4 [not null]
|
|
92
|
+
"unit_price" numeric(10,2) [not null]
|
|
93
|
+
|
|
94
|
+
Indexes {
|
|
95
|
+
(order_id, product_id) [type: btree, name: "uq_order_product"]
|
|
96
|
+
(order_id, product_id) [type: btree, name: "idx_order_items_order_product"]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
Table "all_string_types" {
|
|
101
|
+
"text_col" text [default: 'default_text']
|
|
102
|
+
"varchar_col" varchar(100) [default: 'default_varchar']
|
|
103
|
+
"char_col" bpchar(10) [default: 'default_char']
|
|
104
|
+
"character_varying_col" varchar(50) [default: 'default_character_varying']
|
|
105
|
+
"character_col" bpchar(5) [default: 'default_character']
|
|
106
|
+
"name_col" name [default: 'default_name']
|
|
107
|
+
"bpchar_col" bpchar(15) [default: 'default_bpchar']
|
|
108
|
+
"text_array_col" "text[]" [default: `ARRAY['default_text1', 'default_text2']`]
|
|
109
|
+
"json_col" json [default: `{"default_key": "default_value"}`]
|
|
110
|
+
"jsonb_col" jsonb [default: `{"default_key": "default_value"}`]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
Table "all_default_values" {
|
|
114
|
+
"id" int4 [pk, not null, increment]
|
|
115
|
+
"boolean_col" bool [default: true]
|
|
116
|
+
"integer_col" int4 [default: 42]
|
|
117
|
+
"numeric_col" numeric(10,2) [default: 99.99]
|
|
118
|
+
"date_col" date [default: `CURRENT_DATE`]
|
|
119
|
+
"date_col_specific" date [default: '2024-01-01']
|
|
120
|
+
"timestamp_col" timestamp [default: `CURRENT_TIMESTAMP`]
|
|
121
|
+
"timestamp_col_specific" timestamp [default: '2024-01-01 12:00:00']
|
|
122
|
+
"date_plus_7_days" date [default: `(CURRENT_DATE + '7 days'::interval)`]
|
|
123
|
+
"date_minus_30_days" date [default: `(CURRENT_DATE - '30 days'::interval)`]
|
|
124
|
+
"timestamp_plus_1_hour" timestamp [default: `(CURRENT_TIMESTAMP + '01:00:00'::interval)`]
|
|
125
|
+
"timestamp_minus_15_minutes" timestamp [default: `(CURRENT_TIMESTAMP - '00:15:00'::interval)`]
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
Table "user_define_data_types" {
|
|
129
|
+
"id" int4 [pk, not null, increment]
|
|
130
|
+
"name" varchar(50)
|
|
131
|
+
"gender" gender_type
|
|
132
|
+
"age" int4range
|
|
133
|
+
"height" float8
|
|
134
|
+
"weight" float8
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
Table "table_with_comments" {
|
|
138
|
+
"id" int4 [pk, not null, increment, note: 'Unique identifier for each item.']
|
|
139
|
+
"name" varchar(100) [note: '''Item\'s name.''']
|
|
140
|
+
"description" text [note: '''Item\'s description''']
|
|
141
|
+
"created_at" timestamptz [default: `CURRENT_TIMESTAMP`, note: 'Timestamp when the item was created.']
|
|
142
|
+
Note: '''This table stores information about various items. Such as: \'id\', \'name\', \'description\''''
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
Table "authors" {
|
|
146
|
+
"authorid" int4 [not null, increment]
|
|
147
|
+
"nationalityid" int4 [not null]
|
|
148
|
+
"authorname" varchar(100)
|
|
149
|
+
"birthyear" int4
|
|
150
|
+
|
|
151
|
+
Indexes {
|
|
152
|
+
(authorid, nationalityid) [type: btree, name: "authors_pkey"]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
Table "books" {
|
|
157
|
+
"bookid" int4 [pk, not null, increment]
|
|
158
|
+
"authorid" int4
|
|
159
|
+
"nationalityid" int4
|
|
160
|
+
"isbn" varchar(20) [unique]
|
|
161
|
+
"title" varchar(200)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
Table "table1" {
|
|
165
|
+
"id" int4 [pk, not null, increment]
|
|
166
|
+
"status" enum_type1
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
Table "table2" {
|
|
170
|
+
"id" int4 [pk, not null, increment]
|
|
171
|
+
"status" enum_type2
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
Ref "fk_authornationality":"authors".("authorid", "nationalityid") < "books".("authorid", "nationalityid") [delete: cascade]
|
|
175
|
+
|
|
176
|
+
Ref "fk_order":"orders"."order_id" < "order_items"."order_id" [delete: cascade]
|
|
177
|
+
|
|
178
|
+
Ref "fk_product":"products"."product_id" < "order_items"."product_id" [delete: cascade]
|
|
179
|
+
|
|
180
|
+
Ref "fk_user":"users"."user_id" < "orders"."user_id" [delete: cascade]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
-- SQL dump generated using DBML (dbml.dbdiagram.io)
|
|
2
2
|
-- Database: PostgreSQL
|
|
3
|
-
-- Generated at:
|
|
3
|
+
-- Generated at: 2025-08-29T10:34:30.635Z
|
|
4
4
|
|
|
5
5
|
CREATE SCHEMA "schemaB";
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ CREATE TABLE "users" (
|
|
|
30
30
|
"name" varchar,
|
|
31
31
|
"pjs" job_status,
|
|
32
32
|
"pjs2" job_status,
|
|
33
|
-
"pg" schemaB.gender,
|
|
33
|
+
"pg" "schemaB".gender,
|
|
34
34
|
"pg2" gender
|
|
35
35
|
);
|
|
36
36
|
|
|
@@ -44,7 +44,7 @@ CREATE TABLE "ecommerce"."users" (
|
|
|
44
44
|
"name" varchar,
|
|
45
45
|
"ejs" job_status,
|
|
46
46
|
"ejs2" job_status,
|
|
47
|
-
"eg" schemaB.gender,
|
|
47
|
+
"eg" "schemaB".gender,
|
|
48
48
|
"eg2" gender
|
|
49
49
|
);
|
|
50
50
|
|