@dbml/cli 3.3.0 → 3.4.1-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.
Files changed (81) hide show
  1. package/__test__/dbml2sql/filename --mysql --out-file/dbml-error.log +36 -0
  2. package/__test__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +2 -2
  3. package/__test__/dbml2sql/filename --oracle --out-file/dbml-error.log +0 -0
  4. package/__test__/dbml2sql/filename --oracle --out-file/expect-out-files/schema.sql +57 -0
  5. package/__test__/dbml2sql/filename --oracle --out-file/in-files/schema.dbml +71 -0
  6. package/__test__/dbml2sql/filename --oracle --out-file/options.json +8 -0
  7. package/__test__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +61 -0
  8. package/__test__/dbml2sql/filename --oracle --out-file/stdout.txt +1 -0
  9. package/__test__/dbml2sql/filename --oracle stdout/dbml-error.log +0 -0
  10. package/__test__/dbml2sql/filename --oracle stdout/in-files/schema.dbml +71 -0
  11. package/__test__/dbml2sql/filename --oracle stdout/options.json +6 -0
  12. package/__test__/dbml2sql/filename --oracle stdout/stdout.txt +58 -0
  13. package/__test__/dbml2sql/filename --out-file/dbml-error.log +36 -0
  14. package/__test__/dbml2sql/filename --out-file/out-files/schema.sql +2 -2
  15. package/__test__/dbml2sql/filename --postgres --out-file/dbml-error.log +24 -0
  16. package/__test__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +2 -2
  17. package/__test__/dbml2sql/filenames --mysql --out-file/dbml-error.log +24 -0
  18. package/__test__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +2 -2
  19. package/__test__/dbml2sql/filenames --oracle --out-file/dbml-error.log +0 -0
  20. package/__test__/dbml2sql/filenames --oracle --out-file/expect-out-files/schema.sql +168 -0
  21. package/__test__/dbml2sql/filenames --oracle --out-file/in-files/business.dbml +40 -0
  22. package/__test__/dbml2sql/filenames --oracle --out-file/in-files/customer.dbml +39 -0
  23. package/__test__/dbml2sql/filenames --oracle --out-file/in-files/inventory.dbml +61 -0
  24. package/__test__/dbml2sql/filenames --oracle --out-file/options.json +10 -0
  25. package/__test__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +172 -0
  26. package/__test__/dbml2sql/filenames --oracle --out-file/stdout.txt +1 -0
  27. package/__test__/dbml2sql/filenames --oracle stdout/dbml-error.log +0 -0
  28. package/__test__/dbml2sql/filenames --oracle stdout/in-files/business.dbml +40 -0
  29. package/__test__/dbml2sql/filenames --oracle stdout/in-files/customer.dbml +39 -0
  30. package/__test__/dbml2sql/filenames --oracle stdout/in-files/inventory.dbml +61 -0
  31. package/__test__/dbml2sql/filenames --oracle stdout/options.json +8 -0
  32. package/__test__/dbml2sql/filenames --oracle stdout/stdout.txt +171 -0
  33. package/__test__/dbml2sql/filenames --out-file/dbml-error.log +24 -0
  34. package/__test__/dbml2sql/filenames --out-file/out-files/schema.sql +2 -2
  35. package/__test__/dbml2sql/filenames --postgres --out-file/dbml-error.log +24 -0
  36. package/__test__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +2 -2
  37. package/__test__/dbml2sql/multiple_schema_mssql/dbml-error.log +24 -0
  38. package/__test__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +2 -2
  39. package/__test__/dbml2sql/multiple_schema_mysql/dbml-error.log +24 -0
  40. package/__test__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +2 -2
  41. package/__test__/dbml2sql/multiple_schema_oracle/dbml-error.log +0 -0
  42. package/__test__/dbml2sql/multiple_schema_oracle/expect-out-files/multiple_schema.out.sql +84 -0
  43. package/__test__/dbml2sql/multiple_schema_oracle/in-files/multiple_schema.in.dbml +45 -0
  44. package/__test__/dbml2sql/multiple_schema_oracle/options.json +8 -0
  45. package/__test__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +88 -0
  46. package/__test__/dbml2sql/multiple_schema_oracle/stdout.txt +1 -0
  47. package/__test__/dbml2sql/multiple_schema_pg/dbml-error.log +24 -0
  48. package/__test__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +2 -2
  49. package/__test__/dbml2sql/syntax-error/dbml-error.log +2158 -1074
  50. package/__test__/sql2dbml/filename --mssql --out-file/dbml-error.log +51 -0
  51. package/__test__/sql2dbml/filename --mysql --out-file/dbml-error.log +24 -0
  52. package/__test__/sql2dbml/filename --out-file/dbml-error.log +24 -0
  53. package/__test__/sql2dbml/filename --postgres --out-file/dbml-error.log +24 -0
  54. package/__test__/sql2dbml/filenames --mysql --out-file/dbml-error.log +239 -0
  55. package/__test__/sql2dbml/filenames --mysql stdout/dbml-error.log +218 -0
  56. package/__test__/sql2dbml/filenames --out-file/dbml-error.log +24 -0
  57. package/__test__/sql2dbml/filenames --postgres --out-file/dbml-error.log +24 -0
  58. package/__test__/sql2dbml/multiple_schema_mssql/dbml-error.log +121 -0
  59. package/__test__/sql2dbml/multiple_schema_mysql/dbml-error.log +104 -0
  60. package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +163 -32
  61. package/__test__/sql2dbml/syntax-error/dbml-error.log +2711 -1094
  62. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +1990 -1130
  63. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/stdout.txt +2 -1
  64. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +1985 -1125
  65. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/stdout.txt +2 -1
  66. package/bin/dbml-error.log +0 -0
  67. package/bin/dbml2sql.js +0 -0
  68. package/bin/sql2dbml.js +0 -0
  69. package/dbml-error.log +322 -258
  70. package/lib/cli/config.js +3 -0
  71. package/lib/cli/export.js +4 -3
  72. package/lib/cli/import.js +3 -3
  73. package/lib/cli/index.js +1 -1
  74. package/lib/cli/utils.js +9 -7
  75. package/package.json +3 -3
  76. package/src/cli/config.js +3 -0
  77. package/src/cli/export.js +9 -5
  78. package/src/cli/import.js +4 -5
  79. package/src/cli/index.js +1 -0
  80. package/src/cli/utils.js +5 -7
  81. package/yarn-error.log +0 -87
@@ -0,0 +1,171 @@
1
+ CREATE TABLE "staff" (
2
+ "id" int PRIMARY KEY,
3
+ "first_name" nvarchar2(255),
4
+ "last_name" nvarchar2(255),
5
+ "address_id" int,
6
+ "picture" blob,
7
+ "email" nvarchar2(255),
8
+ "store_id" int,
9
+ "active" number(1),
10
+ "user_name" nvarchar2(255),
11
+ "password" nvarchar2(255),
12
+ "last_update" timestamp
13
+ );
14
+
15
+ CREATE TABLE "store" (
16
+ "id" int PRIMARY KEY,
17
+ "manager_staff_id" int,
18
+ "address_id" int,
19
+ "last_update" timestamp
20
+ );
21
+
22
+ CREATE TABLE "payment" (
23
+ "id" int PRIMARY KEY,
24
+ "customer_id" int,
25
+ "staff_id" int,
26
+ "rental_id" int,
27
+ "amount" float,
28
+ "payment_date" date,
29
+ "last_update" timestamp
30
+ );
31
+
32
+ CREATE TABLE "rental" (
33
+ "id" int PRIMARY KEY,
34
+ "rental_date" date,
35
+ "inventory_id" int,
36
+ "customer_id" int,
37
+ "return_date" date,
38
+ "staff_id" int,
39
+ "last_update" timestamp
40
+ );
41
+
42
+ ALTER TABLE "staff" ADD FOREIGN KEY ("store_id") REFERENCES "store" ("id");
43
+
44
+ ALTER TABLE "store" ADD FOREIGN KEY ("manager_staff_id") REFERENCES "staff" ("id");
45
+
46
+ ALTER TABLE "payment" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
47
+
48
+ ALTER TABLE "payment" ADD FOREIGN KEY ("rental_id") REFERENCES "rental" ("id");
49
+
50
+ ALTER TABLE "rental" ADD FOREIGN KEY ("staff_id") REFERENCES "staff" ("id");
51
+
52
+ CREATE TABLE "country" (
53
+ "id" int PRIMARY KEY,
54
+ "country" nvarchar2(255),
55
+ "last_update" timestamp
56
+ );
57
+
58
+ CREATE TABLE "city" (
59
+ "id" int PRIMARY KEY,
60
+ "city" nvarchar2(255),
61
+ "country_id" int,
62
+ "last_update" timestamp
63
+ );
64
+
65
+ CREATE TABLE "address" (
66
+ "id" int PRIMARY KEY,
67
+ "address" nvarchar2(255),
68
+ "address2" nvarchar2(255),
69
+ "district" nvarchar2(255),
70
+ "city_id" int,
71
+ "postal_code" nvarchar2(255),
72
+ "phone" nvarchar2(255),
73
+ "last_update" timestamp
74
+ );
75
+
76
+ CREATE TABLE "customer" (
77
+ "id" int PRIMARY KEY,
78
+ "store_id" int,
79
+ "first_name" nvarchar2(255),
80
+ "last_name" nvarchar2(255),
81
+ "email" nvarchar2(255),
82
+ "address_id" int,
83
+ "active" number(1),
84
+ "create_Date" timestamp,
85
+ "last_update" timestamp
86
+ );
87
+
88
+ CREATE INDEX "IDX_CUSTOMER" ON "customer" ("id", "first_name");
89
+
90
+ ALTER TABLE "city" ADD FOREIGN KEY ("country_id") REFERENCES "country" ("id");
91
+
92
+ ALTER TABLE "address" ADD FOREIGN KEY ("city_id") REFERENCES "city" ("id");
93
+
94
+ ALTER TABLE "customer" ADD FOREIGN KEY ("address_id") REFERENCES "address" ("id");
95
+
96
+ CREATE TABLE "category" (
97
+ "id" int PRIMARY KEY,
98
+ "name" nvarchar2(255),
99
+ "last_update" timestamp
100
+ );
101
+
102
+ CREATE TABLE "film_category" (
103
+ "id" int PRIMARY KEY,
104
+ "category_id" int,
105
+ "last_update" timestamp
106
+ );
107
+
108
+ CREATE TABLE "language" (
109
+ "id" int PRIMARY KEY,
110
+ "name" nvarchar2(255),
111
+ "last_update" timestamp
112
+ );
113
+
114
+ CREATE TABLE "film_text" (
115
+ "id" int PRIMARY KEY,
116
+ "film_id" int,
117
+ "title" nvarchar2(255),
118
+ "description" nclob
119
+ );
120
+
121
+ CREATE TABLE "actor" (
122
+ "id" int PRIMARY KEY,
123
+ "first_name" nvarchar2(255),
124
+ "last_name" nvarchar2(255),
125
+ "last_update" timestamp
126
+ );
127
+
128
+ CREATE TABLE "film" (
129
+ "id" int PRIMARY KEY,
130
+ "title" nvarchar2(255),
131
+ "description" nclob,
132
+ "releaase_year" int,
133
+ "language_id" int,
134
+ "original_language_id" int,
135
+ "rental_duration" int,
136
+ "rental_rate" float,
137
+ "length" int,
138
+ "replacement_cost" float,
139
+ "rating" nvarchar2(255),
140
+ "special_feature" nvarchar2(255),
141
+ "last_update" timestamp
142
+ );
143
+
144
+ CREATE TABLE "film_actor" (
145
+ "id" int PRIMARY KEY,
146
+ "film_id" int,
147
+ "actor_id" int,
148
+ "last_update" timestamp
149
+ );
150
+
151
+ CREATE TABLE "inventory" (
152
+ "id" int PRIMARY KEY,
153
+ "film_id" int,
154
+ "store_id" int,
155
+ "last_update" timestamp
156
+ );
157
+
158
+ ALTER TABLE "film_category" ADD FOREIGN KEY ("category_id") REFERENCES "category" ("id");
159
+
160
+ ALTER TABLE "film_text" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
161
+
162
+ ALTER TABLE "film" ADD FOREIGN KEY ("language_id") REFERENCES "language" ("id");
163
+
164
+ ALTER TABLE "film" ADD FOREIGN KEY ("original_language_id") REFERENCES "language" ("id");
165
+
166
+ ALTER TABLE "film_actor" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
167
+
168
+ ALTER TABLE "film_actor" ADD FOREIGN KEY ("actor_id") REFERENCES "actor" ("id");
169
+
170
+ ALTER TABLE "inventory" ADD FOREIGN KEY ("film_id") REFERENCES "film" ("id");
171
+
@@ -0,0 +1,24 @@
1
+ 2021-07-13T12:37:50.404Z
2
+ TypeError: Cannot read property 'tick' of undefined
3
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
4
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
5
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
6
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
7
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
8
+ at Module.load (internal/modules/cjs/loader.js:950:32)
9
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
10
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
11
+ at internal/main/run_main_module.js:17:47
12
+
13
+ 2021-07-13T12:58:29.075Z
14
+ TypeError: Cannot read property 'tick' of undefined
15
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
16
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
17
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
18
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
19
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
20
+ at Module.load (internal/modules/cjs/loader.js:950:32)
21
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
22
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
23
+ at internal/main/run_main_module.js:17:47
24
+
@@ -1,6 +1,6 @@
1
- -- SQL dump generated using DBML (dbml-lang.org)
1
+ -- SQL dump generated using DBML (dbml.dbdiagram.io)
2
2
  -- Database: PostgreSQL
3
- -- Generated at: 2024-03-19T03:39:29.091Z
3
+ -- Generated at: 2024-04-11T04:18:16.752Z
4
4
 
5
5
  CREATE TABLE "staff" (
6
6
  "id" int PRIMARY KEY,
@@ -0,0 +1,24 @@
1
+ 2021-07-13T12:37:51.477Z
2
+ TypeError: Cannot read property 'tick' of undefined
3
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
4
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
5
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
6
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
7
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
8
+ at Module.load (internal/modules/cjs/loader.js:950:32)
9
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
10
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
11
+ at internal/main/run_main_module.js:17:47
12
+
13
+ 2021-07-13T12:58:30.073Z
14
+ TypeError: Cannot read property 'tick' of undefined
15
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
16
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
17
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
18
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
19
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
20
+ at Module.load (internal/modules/cjs/loader.js:950:32)
21
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
22
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
23
+ at internal/main/run_main_module.js:17:47
24
+
@@ -1,6 +1,6 @@
1
- -- SQL dump generated using DBML (dbml-lang.org)
1
+ -- SQL dump generated using DBML (dbml.dbdiagram.io)
2
2
  -- Database: PostgreSQL
3
- -- Generated at: 2024-03-19T03:39:29.425Z
3
+ -- Generated at: 2024-04-11T04:18:17.242Z
4
4
 
5
5
  CREATE TABLE "staff" (
6
6
  "id" int PRIMARY KEY,
@@ -0,0 +1,24 @@
1
+ 2021-07-13T12:37:44.406Z
2
+ TypeError: Cannot read property 'tick' of undefined
3
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
4
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
5
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
6
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
7
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
8
+ at Module.load (internal/modules/cjs/loader.js:950:32)
9
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
10
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
11
+ at internal/main/run_main_module.js:17:47
12
+
13
+ 2021-07-13T12:58:23.999Z
14
+ TypeError: Cannot read property 'tick' of undefined
15
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
16
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
17
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
18
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
19
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
20
+ at Module.load (internal/modules/cjs/loader.js:950:32)
21
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
22
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
23
+ at internal/main/run_main_module.js:17:47
24
+
@@ -1,6 +1,6 @@
1
- -- SQL dump generated using DBML (dbml-lang.org)
1
+ -- SQL dump generated using DBML (dbml.dbdiagram.io)
2
2
  -- Database: SQL Server
3
- -- Generated at: 2024-03-19T03:39:30.421Z
3
+ -- Generated at: 2024-04-11T04:18:18.723Z
4
4
 
5
5
  CREATE SCHEMA [schemaB]
6
6
  GO
@@ -0,0 +1,24 @@
1
+ 2021-07-13T12:37:44.406Z
2
+ TypeError: Cannot read property 'tick' of undefined
3
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
4
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
5
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
6
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
7
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
8
+ at Module.load (internal/modules/cjs/loader.js:950:32)
9
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
10
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
11
+ at internal/main/run_main_module.js:17:47
12
+
13
+ 2021-07-13T12:58:23.999Z
14
+ TypeError: Cannot read property 'tick' of undefined
15
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
16
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
17
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
18
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
19
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
20
+ at Module.load (internal/modules/cjs/loader.js:950:32)
21
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
22
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
23
+ at internal/main/run_main_module.js:17:47
24
+
@@ -1,6 +1,6 @@
1
- -- SQL dump generated using DBML (dbml-lang.org)
1
+ -- SQL dump generated using DBML (dbml.dbdiagram.io)
2
2
  -- Database: MySQL
3
- -- Generated at: 2024-03-19T03:39:30.749Z
3
+ -- Generated at: 2024-04-11T04:18:19.177Z
4
4
 
5
5
  CREATE SCHEMA `schemaB`;
6
6
 
@@ -0,0 +1,84 @@
1
+ CREATE USER "C##test01"
2
+ NO AUTHENTICATION
3
+ DEFAULT TABLESPACE system
4
+ TEMPORARY TABLESPACE temp
5
+ QUOTA UNLIMITED ON system;
6
+
7
+ CREATE USER "C##test02"
8
+ NO AUTHENTICATION
9
+ DEFAULT TABLESPACE system
10
+ TEMPORARY TABLESPACE temp
11
+ QUOTA UNLIMITED ON system;
12
+
13
+ CREATE TABLE "users" (
14
+ "id" int PRIMARY KEY
15
+ );
16
+
17
+ CREATE TABLE "products" (
18
+ "id" int PRIMARY KEY,
19
+ "user_id" int NOT NULL
20
+ );
21
+
22
+ CREATE TABLE "C##test02"."users_products" (
23
+ "users_id" int,
24
+ "products_id" int,
25
+ PRIMARY KEY ("users_id", "products_id")
26
+ );
27
+
28
+ CREATE TABLE "users_products" (
29
+ "users_id" int,
30
+ "products_id" int,
31
+ PRIMARY KEY ("users_id", "products_id")
32
+ );
33
+
34
+ CREATE TABLE "C##test01"."users_products" (
35
+ "users_id" int,
36
+ "products_id" int,
37
+ PRIMARY KEY ("users_id", "products_id")
38
+ );
39
+
40
+ CREATE TABLE "C##test01"."users" (
41
+ "id" int PRIMARY KEY
42
+ );
43
+
44
+ CREATE TABLE "C##test01"."products" (
45
+ "id" int PRIMARY KEY,
46
+ "user_id" int NOT NULL
47
+ );
48
+
49
+ CREATE TABLE "C##test02"."users" (
50
+ "id" int PRIMARY KEY
51
+ );
52
+
53
+ CREATE TABLE "C##test02"."products" (
54
+ "id" int PRIMARY KEY,
55
+ "user_id" int NOT NULL
56
+ );
57
+
58
+ GRANT REFERENCES ON "C##test01"."users" TO PUBLIC;
59
+
60
+ GRANT REFERENCES ON "users" TO PUBLIC;
61
+
62
+ GRANT REFERENCES ON "C##test02"."users" TO PUBLIC;
63
+
64
+ GRANT REFERENCES ON "products" TO PUBLIC;
65
+
66
+ GRANT REFERENCES ON "C##test02"."products" TO PUBLIC;
67
+
68
+ ALTER TABLE "products" ADD FOREIGN KEY ("user_id") REFERENCES "C##test01"."users" ("id");
69
+
70
+ ALTER TABLE "C##test01"."products" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id");
71
+
72
+ ALTER TABLE "C##test01"."products" ADD FOREIGN KEY ("user_id") REFERENCES "C##test01"."users" ("id");
73
+
74
+ ALTER TABLE "C##test02"."users_products" ADD FOREIGN KEY ("users_id") REFERENCES "C##test02"."users" ("id");
75
+
76
+ ALTER TABLE "C##test02"."users_products" ADD FOREIGN KEY ("products_id") REFERENCES "products" ("id");
77
+
78
+ ALTER TABLE "users_products" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id");
79
+
80
+ ALTER TABLE "users_products" ADD FOREIGN KEY ("products_id") REFERENCES "C##test02"."products" ("id");
81
+
82
+ ALTER TABLE "C##test01"."users_products" ADD FOREIGN KEY ("users_id") REFERENCES "C##test01"."users" ("id");
83
+
84
+ ALTER TABLE "C##test01"."users_products" ADD FOREIGN KEY ("products_id") REFERENCES "C##test02"."products" ("id");
@@ -0,0 +1,45 @@
1
+ Table users {
2
+ id int [pk]
3
+ }
4
+
5
+ Table products {
6
+ id int [pk]
7
+ user_id int [not null]
8
+ }
9
+
10
+ Table "C##test01"."users" {
11
+ id int [pk]
12
+ }
13
+
14
+ Table "C##test01"."products" {
15
+ id int [pk]
16
+ user_id int [not null]
17
+ }
18
+
19
+ Table "C##test02"."users" {
20
+ id int [pk]
21
+ }
22
+
23
+ Table "C##test02"."products" {
24
+ id int [pk]
25
+ user_id int [not null]
26
+ }
27
+
28
+ // default to schema
29
+ Ref: "C##test01"."users"."id" < "public"."products"."user_id"
30
+
31
+ // schema to default
32
+ Ref: "public"."users"."id" < "C##test01"."products"."user_id"
33
+
34
+ // schema to schema
35
+ Ref: "C##test01"."users"."id" < "C##test01"."products"."user_id"
36
+
37
+ // many to many
38
+ // default - schema
39
+ Ref: "C##test02"."users"."id" <> "public"."products"."id"
40
+
41
+ // schema - default
42
+ Ref: "public"."users"."id" <> "C##test02"."products"."id"
43
+
44
+ // schema - schema
45
+ Ref: "C##test01"."users"."id" <> "C##test02"."products"."id"
@@ -0,0 +1,8 @@
1
+ {
2
+ "args": [
3
+ "./in-files/multiple_schema.in.dbml",
4
+ "--oracle",
5
+ "-o",
6
+ "./out-files/multiple_schema.out.sql"
7
+ ]
8
+ }
@@ -0,0 +1,88 @@
1
+ -- SQL dump generated using DBML (dbml.dbdiagram.io)
2
+ -- Database: Oracle
3
+ -- Generated at: 2024-04-11T04:18:19.613Z
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");
73
+
74
+ ALTER TABLE "C##test01"."products" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id");
75
+
76
+ ALTER TABLE "C##test01"."products" ADD FOREIGN KEY ("user_id") REFERENCES "C##test01"."users" ("id");
77
+
78
+ ALTER TABLE "C##test02"."users_products" ADD FOREIGN KEY ("users_id") REFERENCES "C##test02"."users" ("id");
79
+
80
+ ALTER TABLE "C##test02"."users_products" ADD FOREIGN KEY ("products_id") REFERENCES "products" ("id");
81
+
82
+ ALTER TABLE "users_products" ADD FOREIGN KEY ("users_id") REFERENCES "users" ("id");
83
+
84
+ ALTER TABLE "users_products" ADD FOREIGN KEY ("products_id") REFERENCES "C##test02"."products" ("id");
85
+
86
+ ALTER TABLE "C##test01"."users_products" ADD FOREIGN KEY ("users_id") REFERENCES "C##test01"."users" ("id");
87
+
88
+ ALTER TABLE "C##test01"."users_products" ADD FOREIGN KEY ("products_id") REFERENCES "C##test02"."products" ("id");
@@ -0,0 +1 @@
1
+ ✔ Generated SQL dump file (Oracle): multiple_schema.out.sql
@@ -0,0 +1,24 @@
1
+ 2021-07-13T12:37:44.406Z
2
+ TypeError: Cannot read property 'tick' of undefined
3
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:56)
4
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
5
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
6
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
7
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
8
+ at Module.load (internal/modules/cjs/loader.js:950:32)
9
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
10
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
11
+ at internal/main/run_main_module.js:17:47
12
+
13
+ 2021-07-13T12:58:23.999Z
14
+ TypeError: Cannot read property 'tick' of undefined
15
+ at exportHandler (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\export.js:37:49)
16
+ at dbml2sql (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\src\cli\index.js:19:3)
17
+ at Object.<anonymous> (C:\Users\Inspiron101\Desktop\Holistics\dbml\packages\dbml-cli\__test__\dbml2sql_bin.js:5:1)
18
+ at Module._compile (internal/modules/cjs/loader.js:1085:14)
19
+ at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
20
+ at Module.load (internal/modules/cjs/loader.js:950:32)
21
+ at Function.Module._load (internal/modules/cjs/loader.js:790:14)
22
+ at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
23
+ at internal/main/run_main_module.js:17:47
24
+
@@ -1,6 +1,6 @@
1
- -- SQL dump generated using DBML (dbml-lang.org)
1
+ -- SQL dump generated using DBML (dbml.dbdiagram.io)
2
2
  -- Database: PostgreSQL
3
- -- Generated at: 2024-03-19T03:39:31.085Z
3
+ -- Generated at: 2024-04-11T04:18:20.053Z
4
4
 
5
5
  CREATE SCHEMA "schemaB";
6
6