@dbml/cli 3.7.2 → 3.7.4

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 (71) hide show
  1. package/LICENSE +202 -0
  2. package/__test__/db2dbml/mssql/dbml-error.log +506 -0
  3. package/__test__/db2dbml/mysql/dbml-error.log +320 -0
  4. package/__test__/db2dbml/mysql/out-files/schema.dbml +180 -0
  5. package/__test__/db2dbml/postgres/dbml-error.log +291 -0
  6. package/__test__/db2dbml/postgres/out-files/schema.dbml +140 -0
  7. package/__test__/dbml2sql/filename --mysql --out-file/dbml-error.log +0 -0
  8. package/__test__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +65 -0
  9. package/__test__/dbml2sql/filename --mysql stdout/dbml-error.log +0 -0
  10. package/__test__/dbml2sql/filename --oracle --out-file/dbml-error.log +0 -0
  11. package/__test__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +61 -0
  12. package/__test__/dbml2sql/filename --oracle stdout/dbml-error.log +0 -0
  13. package/__test__/dbml2sql/filename --out-file/dbml-error.log +0 -0
  14. package/__test__/dbml2sql/filename --out-file/out-files/schema.sql +77 -0
  15. package/__test__/dbml2sql/filename --postgres --out-file/dbml-error.log +0 -0
  16. package/__test__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +77 -0
  17. package/__test__/dbml2sql/filename --postgres stdout/dbml-error.log +0 -0
  18. package/__test__/dbml2sql/filename stdout/dbml-error.log +0 -0
  19. package/__test__/dbml2sql/filenames --mysql --out-file/dbml-error.log +0 -0
  20. package/__test__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +172 -0
  21. package/__test__/dbml2sql/filenames --mysql stdout/dbml-error.log +0 -0
  22. package/__test__/dbml2sql/filenames --oracle --out-file/dbml-error.log +0 -0
  23. package/__test__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +172 -0
  24. package/__test__/dbml2sql/filenames --oracle stdout/dbml-error.log +0 -0
  25. package/__test__/dbml2sql/filenames --out-file/dbml-error.log +0 -0
  26. package/__test__/dbml2sql/filenames --out-file/out-files/schema.sql +172 -0
  27. package/__test__/dbml2sql/filenames --postgres --out-file/dbml-error.log +0 -0
  28. package/__test__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +172 -0
  29. package/__test__/dbml2sql/filenames --postgres stdout/dbml-error.log +0 -0
  30. package/__test__/dbml2sql/filenames stdout/dbml-error.log +0 -0
  31. package/__test__/dbml2sql/multiple_schema_mssql/dbml-error.log +0 -0
  32. package/__test__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +62 -0
  33. package/__test__/dbml2sql/multiple_schema_mysql/dbml-error.log +0 -0
  34. package/__test__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +50 -0
  35. package/__test__/dbml2sql/multiple_schema_oracle/dbml-error.log +0 -0
  36. package/__test__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +88 -0
  37. package/__test__/dbml2sql/multiple_schema_pg/dbml-error.log +0 -0
  38. package/__test__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +67 -0
  39. package/__test__/dbml2sql/syntax-error/dbml-error.log +21 -0
  40. package/__test__/sql2dbml/filename --mssql --out-file/dbml-error.log +0 -0
  41. package/__test__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +25 -0
  42. package/__test__/sql2dbml/filename --mysql --out-file/dbml-error.log +0 -0
  43. package/__test__/sql2dbml/filename --mysql --out-file/out-files/schema.dbml +74 -0
  44. package/__test__/sql2dbml/filename --mysql stdout/dbml-error.log +0 -0
  45. package/__test__/sql2dbml/filename --out-file/dbml-error.log +0 -0
  46. package/__test__/sql2dbml/filename --out-file/out-files/schema.dbml +74 -0
  47. package/__test__/sql2dbml/filename --postgres --out-file/dbml-error.log +0 -0
  48. package/__test__/sql2dbml/filename --postgres --out-file/out-files/schema.dbml +74 -0
  49. package/__test__/sql2dbml/filename --postgres stdout/dbml-error.log +0 -0
  50. package/__test__/sql2dbml/filename --snowflake stdout/dbml-error.log +0 -0
  51. package/__test__/sql2dbml/filename stdout/dbml-error.log +0 -0
  52. package/__test__/sql2dbml/filenames --mysql --out-file/dbml-error.log +0 -0
  53. package/__test__/sql2dbml/filenames --mysql --out-file/out-files/schema.dbml +170 -0
  54. package/__test__/sql2dbml/filenames --mysql stdout/dbml-error.log +0 -0
  55. package/__test__/sql2dbml/filenames --out-file/dbml-error.log +0 -0
  56. package/__test__/sql2dbml/filenames --out-file/out-files/schema.dbml +170 -0
  57. package/__test__/sql2dbml/filenames --postgres --out-file/dbml-error.log +0 -0
  58. package/__test__/sql2dbml/filenames --postgres --out-file/out-files/schema.dbml +170 -0
  59. package/__test__/sql2dbml/filenames --postgres stdout/dbml-error.log +0 -0
  60. package/__test__/sql2dbml/filenames stdout/dbml-error.log +0 -0
  61. package/__test__/sql2dbml/multiple_schema_mssql/dbml-error.log +0 -0
  62. package/__test__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +106 -0
  63. package/__test__/sql2dbml/multiple_schema_mysql/dbml-error.log +0 -0
  64. package/__test__/sql2dbml/multiple_schema_mysql/out-files/multiple_schema.out.dbml +136 -0
  65. package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +0 -0
  66. package/__test__/sql2dbml/multiple_schema_pg/out-files/multiple_schema.out.dbml +101 -0
  67. package/__test__/sql2dbml/syntax-error/dbml-error.log +21 -0
  68. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +21 -0
  69. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +21 -0
  70. package/dbml-error.log +59 -0
  71. package/package.json +4 -4
@@ -0,0 +1,136 @@
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
+ }
@@ -0,0 +1,101 @@
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
+ }
@@ -0,0 +1,21 @@
1
+ 2024-06-12T04:32:03.429Z
2
+ undefined
3
+
4
+ 2024-08-09T00:05:09.112Z
5
+ undefined
6
+
7
+ 2024-08-09T03:08:08.840Z
8
+ undefined
9
+
10
+ 2024-08-11T02:28:22.795Z
11
+ undefined
12
+
13
+ 2024-08-14T07:36:59.814Z
14
+ undefined
15
+
16
+ 2024-08-14T07:52:45.007Z
17
+ undefined
18
+
19
+ 2024-08-14T07:55:34.170Z
20
+ undefined
21
+
@@ -0,0 +1,21 @@
1
+ 2024-06-12T04:32:03.669Z
2
+ undefined
3
+
4
+ 2024-08-09T00:05:09.476Z
5
+ undefined
6
+
7
+ 2024-08-09T03:08:09.208Z
8
+ undefined
9
+
10
+ 2024-08-11T02:28:23.316Z
11
+ undefined
12
+
13
+ 2024-08-14T07:37:00.182Z
14
+ undefined
15
+
16
+ 2024-08-14T07:52:45.362Z
17
+ undefined
18
+
19
+ 2024-08-14T07:55:34.526Z
20
+ undefined
21
+
@@ -0,0 +1,21 @@
1
+ 2024-06-12T04:32:04.090Z
2
+ undefined
3
+
4
+ 2024-08-09T00:05:09.972Z
5
+ undefined
6
+
7
+ 2024-08-09T03:08:09.727Z
8
+ undefined
9
+
10
+ 2024-08-11T02:28:24.073Z
11
+ undefined
12
+
13
+ 2024-08-14T07:37:00.693Z
14
+ undefined
15
+
16
+ 2024-08-14T07:52:45.854Z
17
+ undefined
18
+
19
+ 2024-08-14T07:55:35.143Z
20
+ undefined
21
+
package/dbml-error.log ADDED
@@ -0,0 +1,59 @@
1
+ 2024-08-07T02:44:57.506Z
2
+ Error: Error: connect ECONNREFUSED 127.0.0.1:3306
3
+ at _callee8$ (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:474:17)
4
+ at tryCatch (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:1357)
5
+ at Generator.<anonymous> (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:4174)
6
+ at Generator.throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:2208)
7
+ at asyncGeneratorStep (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:17:103)
8
+ at _throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:18:291)
9
+ at processTicksAndRejections (node:internal/process/task_queues:96:5)
10
+
11
+ 2024-08-07T02:51:24.263Z
12
+ Error: Error: MySQL connection error:
13
+ at _callee8$ (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:485:17)
14
+ at tryCatch (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:1357)
15
+ at Generator.<anonymous> (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:4174)
16
+ at Generator.throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:2208)
17
+ at asyncGeneratorStep (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:17:103)
18
+ at _throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:18:291)
19
+ at processTicksAndRejections (node:internal/process/task_queues:96:5)
20
+
21
+ 2024-08-07T02:52:34.901Z
22
+ Error: Error: MySQL connection error: Error: connect ECONNREFUSED 127.0.0.1:3306
23
+ at _callee8$ (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:485:17)
24
+ at tryCatch (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:1357)
25
+ at Generator.<anonymous> (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:4174)
26
+ at Generator.throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:2208)
27
+ at asyncGeneratorStep (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:17:103)
28
+ at _throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:18:291)
29
+ at processTicksAndRejections (node:internal/process/task_queues:96:5)
30
+
31
+ 2024-08-07T02:53:35.536Z
32
+ Error: Error: MySQL connection error: Error: connect ECONNREFUSED 127.0.0.1:3306
33
+ at _callee8$ (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:485:17)
34
+ at tryCatch (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:1357)
35
+ at Generator.<anonymous> (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:4174)
36
+ at Generator.throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:16:2208)
37
+ at asyncGeneratorStep (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:17:103)
38
+ at _throw (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/parse/connection/mysql/utils/sql.js:18:291)
39
+ at processTicksAndRejections (node:internal/process/task_queues:96:5)
40
+
41
+ 2024-08-12T04:39:12.767Z
42
+ TypeError [ERR_INVALID_URL]: Invalid URL
43
+ at new NodeError (node:internal/errors:387:5)
44
+ at URL.onParseError (node:internal/url:565:9)
45
+ at new URL (node:internal/url:641:5)
46
+ at Function.parseUrl (/Users/huylm/code/dbx/dbml/node_modules/mysql2/lib/connection_config.js:263:23)
47
+ at new ConnectionConfig (/Users/huylm/code/dbx/dbml/node_modules/mysql2/lib/connection_config.js:75:34)
48
+ at Object.exports.createConnection (/Users/huylm/code/dbx/dbml/node_modules/mysql2/index.js:10:35)
49
+ at createConnection (/Users/huylm/code/dbx/dbml/node_modules/mysql2/promise.js:252:31)
50
+ at _callee$ (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/connectors/mysqlConnector.js:41:48)
51
+ at tryCatch (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/connectors/mysqlConnector.js:14:1357)
52
+ at Generator.<anonymous> (/Users/huylm/code/dbx/dbml/packages/dbml-core/lib/connectors/mysqlConnector.js:14:4174)
53
+
54
+ 2024-08-25T16:18:11.612Z
55
+ Error: Load credential error: ENOENT: no such file or directory, open 'bigquery'
56
+ at loadCredentialFromFile (/Users/huylm/code/dbx/dbml/packages/dbml-connector/dist/connectors/utils/credential-loader.js:13:19)
57
+ at async fetchSchemaJson (/Users/huylm/code/dbx/dbml/packages/dbml-connector/dist/connectors/bigqueryConnector.js:256:27)
58
+ at async connectionHandler (/Users/huylm/code/dbx/dbml/packages/dbml-cli/lib/cli/connector.js:24:24)
59
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbml/cli",
3
- "version": "3.7.2",
3
+ "version": "3.7.4",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "license": "Apache-2.0",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@babel/cli": "^7.21.0",
29
- "@dbml/connector": "^3.7.2",
30
- "@dbml/core": "^3.7.2",
29
+ "@dbml/connector": "^3.7.4",
30
+ "@dbml/core": "^3.7.4",
31
31
  "bluebird": "^3.5.5",
32
32
  "chalk": "^2.4.2",
33
33
  "commander": "^2.20.0",
@@ -55,7 +55,7 @@
55
55
  "^.+\\.js$": "babel-jest"
56
56
  }
57
57
  },
58
- "gitHead": "b616bcee47dbf0ffc924d10daa0b5836de002fc1",
58
+ "gitHead": "316fd7ce4039ce9b622c30fbb2d03ab2198bd7eb",
59
59
  "engines": {
60
60
  "node": ">=18"
61
61
  }