@dbml/cli 10.3.0-alpha.2 → 10.4.0-alpha.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/__tests__/db2dbml/mssql/dbml-error.log +55 -0
- package/__tests__/db2dbml/mysql/dbml-error.log +15 -0
- package/__tests__/db2dbml/oracle/dbml-error.log +70 -0
- package/__tests__/db2dbml/postgres/dbml-error.log +35 -0
- package/__tests__/dbml2sql/filename --mysql --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +65 -0
- package/__tests__/dbml2sql/filename --mysql stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename --oracle --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +61 -0
- package/__tests__/dbml2sql/filename --oracle stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename --out-file/out-files/schema.sql +77 -0
- package/__tests__/dbml2sql/filename --postgres --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +77 -0
- package/__tests__/dbml2sql/filename --postgres stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filename stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --mysql --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +172 -0
- package/__tests__/dbml2sql/filenames --mysql stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --oracle --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +172 -0
- package/__tests__/dbml2sql/filenames --oracle stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --out-file/out-files/schema.sql +172 -0
- package/__tests__/dbml2sql/filenames --postgres --out-file/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +172 -0
- package/__tests__/dbml2sql/filenames --postgres stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/filenames stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile aliased import stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile circular import stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile complex stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile error entry-syntax-error/dbml-error.log +25 -0
- package/__tests__/dbml2sql/multifile error import-not-found/dbml-error.log +5142 -0
- package/__tests__/dbml2sql/multifile error imported-syntax-error/dbml-error.log +25 -0
- package/__tests__/dbml2sql/multifile error transitive-use-not-visible/dbml-error.log +20 -0
- package/__tests__/dbml2sql/multifile records pulling stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile refs across files stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile schema pulling stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile tablegroup pulling stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multifile transitive reuse stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multiple_schema_mssql/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +62 -0
- package/__tests__/dbml2sql/multiple_schema_mysql/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +50 -0
- package/__tests__/dbml2sql/multiple_schema_oracle/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +88 -0
- package/__tests__/dbml2sql/multiple_schema_pg/dbml-error.log +0 -0
- package/__tests__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +67 -0
- package/__tests__/dbml2sql/single file stdout/dbml-error.log +0 -0
- package/__tests__/dbml2sql/syntax-error/dbml-error.log +25 -0
- package/__tests__/sql2dbml/custom-error-alter-table-column-not-found --oracle/dbml-error.log +20 -0
- package/__tests__/sql2dbml/custom-error-alter-table-table-not-found --oracle/dbml-error.log +20 -0
- package/__tests__/sql2dbml/custom-error-column-comment-column-not-found --oracle/dbml-error.log +20 -0
- package/__tests__/sql2dbml/custom-error-column-comment-table-not-found --oracle/dbml-error.log +20 -0
- package/__tests__/sql2dbml/custom-error-create-index-table-not-found --oracle/dbml-error.log +20 -0
- package/__tests__/sql2dbml/custom-error-table-comment-table-not-found --oracle/dbml-error.log +20 -0
- package/__tests__/sql2dbml/filename --mssql --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +25 -0
- package/__tests__/sql2dbml/filename --mysql --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --mysql --out-file/out-files/schema.dbml +74 -0
- package/__tests__/sql2dbml/filename --mysql stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --oracle --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --oracle --out-file/out-files/schema.dbml +83 -0
- package/__tests__/sql2dbml/filename --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --out-file/out-files/schema.dbml +74 -0
- package/__tests__/sql2dbml/filename --postgres --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --postgres --out-file/out-files/schema.dbml +74 -0
- package/__tests__/sql2dbml/filename --postgres stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename --snowflake stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filename stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filenames --mysql --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filenames --mysql --out-file/out-files/schema.dbml +170 -0
- package/__tests__/sql2dbml/filenames --mysql stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filenames --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filenames --out-file/out-files/schema.dbml +170 -0
- package/__tests__/sql2dbml/filenames --postgres --out-file/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filenames --postgres --out-file/out-files/schema.dbml +170 -0
- package/__tests__/sql2dbml/filenames --postgres stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/filenames stdout/dbml-error.log +0 -0
- package/__tests__/sql2dbml/multiple_schema_mssql/dbml-error.log +0 -0
- package/__tests__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +58 -0
- package/__tests__/sql2dbml/multiple_schema_mysql/dbml-error.log +0 -0
- package/__tests__/sql2dbml/multiple_schema_mysql/out-files/multiple_schema.out.dbml +136 -0
- package/__tests__/sql2dbml/multiple_schema_pg/dbml-error.log +0 -0
- package/__tests__/sql2dbml/multiple_schema_pg/out-files/multiple_schema.out.dbml +101 -0
- package/__tests__/sql2dbml/syntax-error/dbml-error.log +20 -0
- package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +20 -0
- package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +20 -0
- package/lib/index.js +14 -9
- package/package.json +5 -5
- package/src/NodeProjectLayout.ts +12 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
2026-06-15T10:57:46.746Z
|
|
2
|
+
|
|
3
|
+
./in-files/broken.dbml(4,1): Expect an identifier
|
|
4
|
+
./in-files/broken.dbml(2,11): Unknown column setting 'pk name varchar'
|
|
5
|
+
|
|
6
|
+
2026-06-15T10:58:51.926Z
|
|
7
|
+
|
|
8
|
+
./in-files/broken.dbml(4,1): Expect an identifier
|
|
9
|
+
./in-files/broken.dbml(2,11): Unknown column setting 'pk name varchar'
|
|
10
|
+
|
|
11
|
+
2026-07-22T11:03:37.719Z
|
|
12
|
+
|
|
13
|
+
./in-files/broken.dbml(4,1): Expect an identifier
|
|
14
|
+
./in-files/broken.dbml(2,11): Custom setting 'pk name varchar' must be a string or a color literal
|
|
15
|
+
|
|
16
|
+
2026-07-22T11:07:10.314Z
|
|
17
|
+
|
|
18
|
+
./in-files/broken.dbml(4,1): Expect an identifier
|
|
19
|
+
./in-files/broken.dbml(2,11): Custom setting 'pk name varchar' must be a string or a color literal
|
|
20
|
+
|
|
21
|
+
2026-07-22T11:09:52.085Z
|
|
22
|
+
|
|
23
|
+
./in-files/broken.dbml(4,1): Expect an identifier
|
|
24
|
+
./in-files/broken.dbml(2,11): Custom setting 'pk name varchar' must be a string or a color literal
|
|
25
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:47.480Z
|
|
2
|
+
|
|
3
|
+
./in-files/main.dbml(3,17): Table 'products' does not exist in Schema 'public'
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:58:52.521Z
|
|
6
|
+
|
|
7
|
+
./in-files/main.dbml(3,17): Table 'products' does not exist in Schema 'public'
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:38.305Z
|
|
10
|
+
|
|
11
|
+
./in-files/main.dbml(3,17): Table 'products' does not exist in Schema 'public'
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:10.911Z
|
|
14
|
+
|
|
15
|
+
./in-files/main.dbml(3,17): Table 'products' does not exist in Schema 'public'
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:09:52.678Z
|
|
18
|
+
|
|
19
|
+
./in-files/main.dbml(3,17): Table 'products' does not exist in Schema 'public'
|
|
20
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml.dbdiagram.io)
|
|
2
|
+
-- Database: SQL Server
|
|
3
|
+
-- Generated at: 2026-07-22T11:09:56.224Z
|
|
4
|
+
|
|
5
|
+
CREATE SCHEMA [schemaB]
|
|
6
|
+
GO
|
|
7
|
+
|
|
8
|
+
CREATE SCHEMA [ecommerce]
|
|
9
|
+
GO
|
|
10
|
+
|
|
11
|
+
CREATE SCHEMA [schemaA]
|
|
12
|
+
GO
|
|
13
|
+
|
|
14
|
+
CREATE TABLE [users] (
|
|
15
|
+
[id] int PRIMARY KEY,
|
|
16
|
+
[name] nvarchar(255),
|
|
17
|
+
[pjs] nvarchar(255) NOT NULL CHECK ([pjs] IN ('created2', 'running2', 'done2', 'failure2')),
|
|
18
|
+
[pjs2] nvarchar(255) NOT NULL CHECK ([pjs2] IN ('created2', 'running2', 'done2', 'failure2')),
|
|
19
|
+
[pg] nvarchar(255) NOT NULL CHECK ([pg] IN ('male', 'female')),
|
|
20
|
+
[pg2] nvarchar(255) NOT NULL CHECK ([pg2] IN ('male2', 'female2'))
|
|
21
|
+
)
|
|
22
|
+
GO
|
|
23
|
+
|
|
24
|
+
CREATE TABLE [products] (
|
|
25
|
+
[id] int PRIMARY KEY,
|
|
26
|
+
[name] nvarchar(255)
|
|
27
|
+
)
|
|
28
|
+
GO
|
|
29
|
+
|
|
30
|
+
CREATE TABLE [ecommerce].[users] (
|
|
31
|
+
[id] int PRIMARY KEY,
|
|
32
|
+
[name] nvarchar(255),
|
|
33
|
+
[ejs] nvarchar(255) NOT NULL CHECK ([ejs] IN ('created2', 'running2', 'done2', 'failure2')),
|
|
34
|
+
[ejs2] nvarchar(255) NOT NULL CHECK ([ejs2] IN ('created2', 'running2', 'done2', 'failure2')),
|
|
35
|
+
[eg] nvarchar(255) NOT NULL CHECK ([eg] IN ('male', 'female')),
|
|
36
|
+
[eg2] nvarchar(255) NOT NULL CHECK ([eg2] IN ('male2', 'female2'))
|
|
37
|
+
)
|
|
38
|
+
GO
|
|
39
|
+
|
|
40
|
+
CREATE TABLE [schemaA].[products] (
|
|
41
|
+
[id] int PRIMARY KEY,
|
|
42
|
+
[name] nvarchar(255)
|
|
43
|
+
)
|
|
44
|
+
GO
|
|
45
|
+
|
|
46
|
+
CREATE TABLE [schemaA].[locations] (
|
|
47
|
+
[id] int PRIMARY KEY,
|
|
48
|
+
[name] nvarchar(255)
|
|
49
|
+
)
|
|
50
|
+
GO
|
|
51
|
+
|
|
52
|
+
ALTER TABLE [schemaA].[products] ADD FOREIGN KEY ([name]) REFERENCES [ecommerce].[users] ([id])
|
|
53
|
+
GO
|
|
54
|
+
|
|
55
|
+
ALTER TABLE [schemaA].[locations] ADD FOREIGN KEY ([name]) REFERENCES [users] ([id])
|
|
56
|
+
GO
|
|
57
|
+
|
|
58
|
+
ALTER TABLE [ecommerce].[users] ADD FOREIGN KEY ([id]) REFERENCES [users] ([id])
|
|
59
|
+
GO
|
|
60
|
+
|
|
61
|
+
ALTER TABLE [ecommerce].[users] ADD CONSTRAINT [name_optional] FOREIGN KEY ([id]) REFERENCES [users] ([name])
|
|
62
|
+
GO
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml.dbdiagram.io)
|
|
2
|
+
-- Database: MySQL
|
|
3
|
+
-- Generated at: 2026-07-22T11:09:56.824Z
|
|
4
|
+
|
|
5
|
+
CREATE SCHEMA `schemaB`;
|
|
6
|
+
|
|
7
|
+
CREATE SCHEMA `ecommerce`;
|
|
8
|
+
|
|
9
|
+
CREATE SCHEMA `schemaA`;
|
|
10
|
+
|
|
11
|
+
CREATE TABLE `users` (
|
|
12
|
+
`id` int PRIMARY KEY,
|
|
13
|
+
`name` varchar(255),
|
|
14
|
+
`pjs` ENUM ('created2', 'running2', 'done2', 'failure2'),
|
|
15
|
+
`pjs2` ENUM ('created2', 'running2', 'done2', 'failure2'),
|
|
16
|
+
`pg` ENUM ('male', 'female'),
|
|
17
|
+
`pg2` ENUM ('male2', 'female2')
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
CREATE TABLE `products` (
|
|
21
|
+
`id` int PRIMARY KEY,
|
|
22
|
+
`name` varchar(255)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
CREATE TABLE `ecommerce`.`users` (
|
|
26
|
+
`id` int PRIMARY KEY,
|
|
27
|
+
`name` varchar(255),
|
|
28
|
+
`ejs` ENUM ('created2', 'running2', 'done2', 'failure2'),
|
|
29
|
+
`ejs2` ENUM ('created2', 'running2', 'done2', 'failure2'),
|
|
30
|
+
`eg` ENUM ('male', 'female'),
|
|
31
|
+
`eg2` ENUM ('male2', 'female2')
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
CREATE TABLE `schemaA`.`products` (
|
|
35
|
+
`id` int PRIMARY KEY,
|
|
36
|
+
`name` varchar(255)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
CREATE TABLE `schemaA`.`locations` (
|
|
40
|
+
`id` int PRIMARY KEY,
|
|
41
|
+
`name` varchar(255)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
ALTER TABLE `schemaA`.`products` ADD FOREIGN KEY (`name`) REFERENCES `ecommerce`.`users` (`id`);
|
|
45
|
+
|
|
46
|
+
ALTER TABLE `schemaA`.`locations` ADD FOREIGN KEY (`name`) REFERENCES `users` (`id`);
|
|
47
|
+
|
|
48
|
+
ALTER TABLE `ecommerce`.`users` ADD FOREIGN KEY (`id`) REFERENCES `users` (`id`);
|
|
49
|
+
|
|
50
|
+
ALTER TABLE `ecommerce`.`users` ADD CONSTRAINT `name_optional` FOREIGN KEY (`id`) REFERENCES `users` (`name`);
|
|
File without changes
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml.dbdiagram.io)
|
|
2
|
+
-- Database: Oracle
|
|
3
|
+
-- Generated at: 2026-07-22T11:09:57.428Z
|
|
4
|
+
|
|
5
|
+
CREATE USER "C##test01"
|
|
6
|
+
NO AUTHENTICATION
|
|
7
|
+
DEFAULT TABLESPACE system
|
|
8
|
+
TEMPORARY TABLESPACE temp
|
|
9
|
+
QUOTA UNLIMITED ON system;
|
|
10
|
+
|
|
11
|
+
CREATE USER "C##test02"
|
|
12
|
+
NO AUTHENTICATION
|
|
13
|
+
DEFAULT TABLESPACE system
|
|
14
|
+
TEMPORARY TABLESPACE temp
|
|
15
|
+
QUOTA UNLIMITED ON system;
|
|
16
|
+
|
|
17
|
+
CREATE TABLE "users" (
|
|
18
|
+
"id" int PRIMARY KEY
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CREATE TABLE "products" (
|
|
22
|
+
"id" int PRIMARY KEY,
|
|
23
|
+
"user_id" int NOT NULL
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
CREATE TABLE "C##test02"."users_products" (
|
|
27
|
+
"users_id" int,
|
|
28
|
+
"products_id" int,
|
|
29
|
+
PRIMARY KEY ("users_id", "products_id")
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
CREATE TABLE "users_products" (
|
|
33
|
+
"users_id" int,
|
|
34
|
+
"products_id" int,
|
|
35
|
+
PRIMARY KEY ("users_id", "products_id")
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
CREATE TABLE "C##test01"."users_products" (
|
|
39
|
+
"users_id" int,
|
|
40
|
+
"products_id" int,
|
|
41
|
+
PRIMARY KEY ("users_id", "products_id")
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
CREATE TABLE "C##test01"."users" (
|
|
45
|
+
"id" int PRIMARY KEY
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
CREATE TABLE "C##test01"."products" (
|
|
49
|
+
"id" int PRIMARY KEY,
|
|
50
|
+
"user_id" int NOT NULL
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
CREATE TABLE "C##test02"."users" (
|
|
54
|
+
"id" int PRIMARY KEY
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
CREATE TABLE "C##test02"."products" (
|
|
58
|
+
"id" int PRIMARY KEY,
|
|
59
|
+
"user_id" int NOT NULL
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
GRANT REFERENCES ON "C##test01"."users" TO PUBLIC;
|
|
63
|
+
|
|
64
|
+
GRANT REFERENCES ON "users" TO PUBLIC;
|
|
65
|
+
|
|
66
|
+
GRANT REFERENCES ON "C##test02"."users" TO PUBLIC;
|
|
67
|
+
|
|
68
|
+
GRANT REFERENCES ON "products" TO PUBLIC;
|
|
69
|
+
|
|
70
|
+
GRANT REFERENCES ON "C##test02"."products" TO PUBLIC;
|
|
71
|
+
|
|
72
|
+
ALTER TABLE "products" ADD FOREIGN KEY ("user_id") REFERENCES "C##test01"."users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
73
|
+
|
|
74
|
+
ALTER TABLE "C##test01"."products" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
75
|
+
|
|
76
|
+
ALTER TABLE "C##test01"."products" ADD FOREIGN KEY ("user_id") REFERENCES "C##test01"."users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
77
|
+
|
|
78
|
+
ALTER TABLE "C##test02"."users_products" ADD FOREIGN KEY ("users_id") REFERENCES "C##test02"."users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
79
|
+
|
|
80
|
+
ALTER TABLE "C##test02"."users_products" ADD FOREIGN KEY ("products_id") REFERENCES "products" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
81
|
+
|
|
82
|
+
ALTER TABLE "users_products" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
83
|
+
|
|
84
|
+
ALTER TABLE "users_products" ADD FOREIGN KEY ("products_id") REFERENCES "C##test02"."products" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
85
|
+
|
|
86
|
+
ALTER TABLE "C##test01"."users_products" ADD FOREIGN KEY ("users_id") REFERENCES "C##test01"."users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
87
|
+
|
|
88
|
+
ALTER TABLE "C##test01"."users_products" ADD FOREIGN KEY ("products_id") REFERENCES "C##test02"."products" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
-- SQL dump generated using DBML (dbml.dbdiagram.io)
|
|
2
|
+
-- Database: PostgreSQL
|
|
3
|
+
-- Generated at: 2026-07-22T11:09:58.023Z
|
|
4
|
+
|
|
5
|
+
CREATE SCHEMA "schemaB";
|
|
6
|
+
|
|
7
|
+
CREATE SCHEMA "ecommerce";
|
|
8
|
+
|
|
9
|
+
CREATE SCHEMA "schemaA";
|
|
10
|
+
|
|
11
|
+
CREATE TYPE "job_status" AS ENUM (
|
|
12
|
+
'created2',
|
|
13
|
+
'running2',
|
|
14
|
+
'done2',
|
|
15
|
+
'failure2'
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
CREATE TYPE "gender" AS ENUM (
|
|
19
|
+
'male2',
|
|
20
|
+
'female2'
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
CREATE TYPE "schemaB"."gender" AS ENUM (
|
|
24
|
+
'male',
|
|
25
|
+
'female'
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
CREATE TABLE "users" (
|
|
29
|
+
"id" int PRIMARY KEY,
|
|
30
|
+
"name" varchar,
|
|
31
|
+
"pjs" job_status,
|
|
32
|
+
"pjs2" job_status,
|
|
33
|
+
"pg" "schemaB".gender,
|
|
34
|
+
"pg2" gender
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
CREATE TABLE "products" (
|
|
38
|
+
"id" int PRIMARY KEY,
|
|
39
|
+
"name" varchar
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
CREATE TABLE "ecommerce"."users" (
|
|
43
|
+
"id" int PRIMARY KEY,
|
|
44
|
+
"name" varchar,
|
|
45
|
+
"ejs" job_status,
|
|
46
|
+
"ejs2" job_status,
|
|
47
|
+
"eg" "schemaB".gender,
|
|
48
|
+
"eg2" gender
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
CREATE TABLE "schemaA"."products" (
|
|
52
|
+
"id" int PRIMARY KEY,
|
|
53
|
+
"name" varchar
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
CREATE TABLE "schemaA"."locations" (
|
|
57
|
+
"id" int PRIMARY KEY,
|
|
58
|
+
"name" varchar
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
ALTER TABLE "schemaA"."products" ADD FOREIGN KEY ("name") REFERENCES "ecommerce"."users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
62
|
+
|
|
63
|
+
ALTER TABLE "schemaA"."locations" ADD FOREIGN KEY ("name") REFERENCES "users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
64
|
+
|
|
65
|
+
ALTER TABLE "ecommerce"."users" ADD FOREIGN KEY ("id") REFERENCES "users" ("id") DEFERRABLE INITIALLY IMMEDIATE;
|
|
66
|
+
|
|
67
|
+
ALTER TABLE "ecommerce"."users" ADD CONSTRAINT "name_optional" FOREIGN KEY ("id") REFERENCES "users" ("name") DEFERRABLE INITIALLY IMMEDIATE;
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
2026-06-15T10:57:55.049Z
|
|
2
|
+
|
|
3
|
+
ecommerce.dbml(17,24): Expect an identifier
|
|
4
|
+
ecommerce.dbml(16,11): Unknown column setting 'pk manager_staff_id int'
|
|
5
|
+
|
|
6
|
+
2026-06-15T10:58:59.111Z
|
|
7
|
+
|
|
8
|
+
ecommerce.dbml(17,24): Expect an identifier
|
|
9
|
+
ecommerce.dbml(16,11): Unknown column setting 'pk manager_staff_id int'
|
|
10
|
+
|
|
11
|
+
2026-07-22T11:03:44.850Z
|
|
12
|
+
|
|
13
|
+
ecommerce.dbml(17,24): Expect an identifier
|
|
14
|
+
ecommerce.dbml(17,30): Custom setting 'pk manager_staff_id int' must be a string or a color literal
|
|
15
|
+
|
|
16
|
+
2026-07-22T11:07:17.627Z
|
|
17
|
+
|
|
18
|
+
ecommerce.dbml(17,24): Expect an identifier
|
|
19
|
+
ecommerce.dbml(17,30): Custom setting 'pk manager_staff_id int' must be a string or a color literal
|
|
20
|
+
|
|
21
|
+
2026-07-22T11:09:59.265Z
|
|
22
|
+
|
|
23
|
+
ecommerce.dbml(17,24): Expect an identifier
|
|
24
|
+
ecommerce.dbml(17,30): Custom setting 'pk manager_staff_id int' must be a string or a color literal
|
|
25
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:55.826Z
|
|
2
|
+
|
|
3
|
+
You have a syntax error at "schema.sql" line 1 column 1. Column "name" do not exist in table "Users"
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:58:59.805Z
|
|
6
|
+
|
|
7
|
+
You have a syntax error at "schema.sql" line 1 column 1. Column "name" do not exist in table "Users"
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:45.565Z
|
|
10
|
+
|
|
11
|
+
You have a syntax error at "schema.sql" line 1 column 1. Column "name" do not exist in table "Users"
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:18.369Z
|
|
14
|
+
|
|
15
|
+
You have a syntax error at "schema.sql" line 1 column 1. Column "name" do not exist in table "Users"
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:09:59.964Z
|
|
18
|
+
|
|
19
|
+
You have a syntax error at "schema.sql" line 1 column 1. Column "name" do not exist in table "Users"
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:56.588Z
|
|
2
|
+
|
|
3
|
+
You have a syntax error at "schema.sql" line 1 column 13. Table "Users" not found
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:59:00.474Z
|
|
6
|
+
|
|
7
|
+
You have a syntax error at "schema.sql" line 1 column 13. Table "Users" not found
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:46.249Z
|
|
10
|
+
|
|
11
|
+
You have a syntax error at "schema.sql" line 1 column 13. Table "Users" not found
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:19.062Z
|
|
14
|
+
|
|
15
|
+
You have a syntax error at "schema.sql" line 1 column 13. Table "Users" not found
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:10:00.633Z
|
|
18
|
+
|
|
19
|
+
You have a syntax error at "schema.sql" line 1 column 13. Table "Users" not found
|
|
20
|
+
|
package/__tests__/sql2dbml/custom-error-column-comment-column-not-found --oracle/dbml-error.log
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:57.324Z
|
|
2
|
+
|
|
3
|
+
You have a syntax error at "schema.sql" line 5 column 19. Column "name" not found in table "Users"
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:59:01.152Z
|
|
6
|
+
|
|
7
|
+
You have a syntax error at "schema.sql" line 5 column 19. Column "name" not found in table "Users"
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:46.950Z
|
|
10
|
+
|
|
11
|
+
You have a syntax error at "schema.sql" line 5 column 19. Column "name" not found in table "Users"
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:19.781Z
|
|
14
|
+
|
|
15
|
+
You have a syntax error at "schema.sql" line 5 column 19. Column "name" not found in table "Users"
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:10:01.330Z
|
|
18
|
+
|
|
19
|
+
You have a syntax error at "schema.sql" line 5 column 19. Column "name" not found in table "Users"
|
|
20
|
+
|
package/__tests__/sql2dbml/custom-error-column-comment-table-not-found --oracle/dbml-error.log
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:58.140Z
|
|
2
|
+
|
|
3
|
+
You have a syntax error at "schema.sql" line 5 column 19. Table "Posts" not found
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:59:01.857Z
|
|
6
|
+
|
|
7
|
+
You have a syntax error at "schema.sql" line 5 column 19. Table "Posts" not found
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:47.703Z
|
|
10
|
+
|
|
11
|
+
You have a syntax error at "schema.sql" line 5 column 19. Table "Posts" not found
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:20.484Z
|
|
14
|
+
|
|
15
|
+
You have a syntax error at "schema.sql" line 5 column 19. Table "Posts" not found
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:10:02.028Z
|
|
18
|
+
|
|
19
|
+
You have a syntax error at "schema.sql" line 5 column 19. Table "Posts" not found
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:58.952Z
|
|
2
|
+
|
|
3
|
+
You have a syntax error at "schema.sql" line 1 column 28. Table Users not found
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:59:02.515Z
|
|
6
|
+
|
|
7
|
+
You have a syntax error at "schema.sql" line 1 column 28. Table Users not found
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:48.395Z
|
|
10
|
+
|
|
11
|
+
You have a syntax error at "schema.sql" line 1 column 28. Table Users not found
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:21.181Z
|
|
14
|
+
|
|
15
|
+
You have a syntax error at "schema.sql" line 1 column 28. Table Users not found
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:10:02.726Z
|
|
18
|
+
|
|
19
|
+
You have a syntax error at "schema.sql" line 1 column 28. Table Users not found
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
2026-06-15T10:57:59.710Z
|
|
2
|
+
|
|
3
|
+
You have a syntax error at "schema.sql" line 5 column 18. Table "Posts" not found
|
|
4
|
+
|
|
5
|
+
2026-06-15T10:59:03.186Z
|
|
6
|
+
|
|
7
|
+
You have a syntax error at "schema.sql" line 5 column 18. Table "Posts" not found
|
|
8
|
+
|
|
9
|
+
2026-07-22T11:03:49.135Z
|
|
10
|
+
|
|
11
|
+
You have a syntax error at "schema.sql" line 5 column 18. Table "Posts" not found
|
|
12
|
+
|
|
13
|
+
2026-07-22T11:07:21.886Z
|
|
14
|
+
|
|
15
|
+
You have a syntax error at "schema.sql" line 5 column 18. Table "Posts" not found
|
|
16
|
+
|
|
17
|
+
2026-07-22T11:10:03.411Z
|
|
18
|
+
|
|
19
|
+
You have a syntax error at "schema.sql" line 5 column 18. Table "Posts" not found
|
|
20
|
+
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Table "UserMaster" {
|
|
2
|
+
"UserMasterKey" "BIGINT IDENTITY(1,1)" [not null]
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
Table "CodeDef" {
|
|
6
|
+
"CdKey" "BIGINT IDENTITY(1,1)" [not null]
|
|
7
|
+
"Category" NVARCHAR(50) [not null]
|
|
8
|
+
"Description" NVARCHAR(100)
|
|
9
|
+
"Code" NVARCHAR(50) [not null]
|
|
10
|
+
"ParentCdKey" BIGINT
|
|
11
|
+
"UserMasterKeyAddedBy" BIGINT [not null]
|
|
12
|
+
"UserMasterKeyLastEditedBy" BIGINT
|
|
13
|
+
"AddedDtTm" DATETIMEOFFSET(7) [not null]
|
|
14
|
+
"LastEditedDtTm" DATETIMEOFFSET(7)
|
|
15
|
+
"EffectiveFromDtTm" DATETIMEOFFSET(7) [not null]
|
|
16
|
+
"EffectiveThruDtTm" DATETIMEOFFSET(7)
|
|
17
|
+
|
|
18
|
+
Indexes {
|
|
19
|
+
CdKey [pk, name: "PK__CodeDef__4922449ECDD244C3"]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Ref "fk__CodeDef__ParentCdKey__CodeDef__CdKey":"CodeDef"."CdKey" < "CodeDef"."ParentCdKey"
|
|
24
|
+
|
|
25
|
+
Ref "fk__CodeDef__UserMasterKeyLastEditedBy__UserMaster_UserMasterKey":"UserMaster"."UserMasterKey" < "CodeDef"."UserMasterKeyLastEditedBy"
|
|
File without changes
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Enum "orders_status_enum" {
|
|
2
|
+
"created"
|
|
3
|
+
"running"
|
|
4
|
+
"done"
|
|
5
|
+
"failure"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
Enum "products_status_enum" {
|
|
9
|
+
"Out of Stock"
|
|
10
|
+
"In Stock"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
Table "orders" {
|
|
14
|
+
"id" int [pk, increment]
|
|
15
|
+
"user_id" int [unique, not null]
|
|
16
|
+
"status" orders_status_enum
|
|
17
|
+
"created_at" varchar(255)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Table "order_items" {
|
|
21
|
+
"order_id" int
|
|
22
|
+
"product_id" int
|
|
23
|
+
"quantity" int [default: 1]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Table "products" {
|
|
27
|
+
"id" int [pk]
|
|
28
|
+
"name" varchar(255)
|
|
29
|
+
"merchant_id" int [not null]
|
|
30
|
+
"price" int
|
|
31
|
+
"status" products_status_enum
|
|
32
|
+
"created_at" datetime [default: `now()`]
|
|
33
|
+
|
|
34
|
+
Indexes {
|
|
35
|
+
(merchant_id, status) [name: "product_status"]
|
|
36
|
+
id [type: hash, unique, name: "products_index_1"]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Table "users" {
|
|
41
|
+
"id" int [pk]
|
|
42
|
+
"full_name" varchar(255)
|
|
43
|
+
"email" varchar(255) [unique]
|
|
44
|
+
"gender" varchar(255)
|
|
45
|
+
"date_of_birth" varchar(255)
|
|
46
|
+
"created_at" varchar(255)
|
|
47
|
+
"country_code" int
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Table "merchants" {
|
|
51
|
+
"id" int [pk]
|
|
52
|
+
"merchant_name" varchar(255)
|
|
53
|
+
"country_code" int
|
|
54
|
+
"created_at" varchar(255)
|
|
55
|
+
"admin_id" int
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Table "countries" {
|
|
59
|
+
"code" int [pk]
|
|
60
|
+
"name" varchar(255)
|
|
61
|
+
"continent_name" varchar(255)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Ref:"orders"."id" < "order_items"."order_id"
|
|
65
|
+
|
|
66
|
+
Ref:"products"."id" < "order_items"."product_id"
|
|
67
|
+
|
|
68
|
+
Ref:"countries"."code" < "users"."country_code"
|
|
69
|
+
|
|
70
|
+
Ref:"countries"."code" < "merchants"."country_code"
|
|
71
|
+
|
|
72
|
+
Ref:"merchants"."id" < "products"."merchant_id"
|
|
73
|
+
|
|
74
|
+
Ref:"users"."id" < "merchants"."admin_id"
|
|
File without changes
|
|
File without changes
|