@dbml/cli 5.2.0 → 5.3.1
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 +22 -0
- package/__test__/db2dbml/mysql/dbml-error.log +6 -0
- package/__test__/db2dbml/oracle/dbml-error.log +11 -0
- package/__test__/db2dbml/oracle/out-files/schema.dbml +46 -0
- package/__test__/db2dbml/postgres/dbml-error.log +7 -0
- package/__test__/db2dbml/sqlite/dbml-error.log +52 -0
- package/__test__/db2dbml/sqlite/out-files/schema.dbml +108 -0
- package/{__tests__ → __test__}/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filename --oracle --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +1 -1
- package/{__tests__ → __test__}/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +1 -1
- package/__test__/dbml2sql/syntax-error/dbml-error.log +1533 -0
- package/{__tests__ → __test__}/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +56 -8
- package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +52 -0
- package/__test__/sql2dbml/syntax-error/dbml-error.log +1557 -0
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +1615 -0
- package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +1615 -0
- package/__tests__/db2dbml/oracle/expect-out-files/schema.dbml +419 -0
- package/__tests__/db2dbml/oracle/options.json +8 -0
- package/__tests__/db2dbml/oracle/schema.sql +529 -0
- package/__tests__/db2dbml/oracle/stdout.txt +1 -0
- package/dbml-error.log +562 -0
- package/lib/cli/index.js +1 -0
- package/lib/cli/utils.js +1 -1
- package/package.json +4 -4
- package/src/cli/index.js +1 -0
- package/src/cli/utils.js +1 -1
- package/yarn-error.log +87 -0
- package/__tests__/db2dbml/mssql/dbml-error.log +0 -11
- package/__tests__/db2dbml/mssql/out-files/schema.dbml +0 -219
- package/__tests__/db2dbml/mysql/dbml-error.log +0 -3
- package/__tests__/db2dbml/mysql/out-files/schema.dbml +0 -188
- package/__tests__/db2dbml/postgres/dbml-error.log +0 -7
- package/__tests__/db2dbml/postgres/out-files/schema.dbml +0 -184
- package/__tests__/dbml2sql/syntax-error/dbml-error.log +0 -9
- package/__tests__/sql2dbml/multiple_schema_pg/dbml-error.log +0 -0
- package/__tests__/sql2dbml/syntax-error/dbml-error.log +0 -9
- package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +0 -9
- package/__tests__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +0 -9
- /package/{__tests__ → __test__}/dbml2sql/filename --mysql --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename --mysql stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename --oracle --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename --oracle stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename --postgres --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename --postgres stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filename stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --mysql --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --mysql stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --oracle --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --oracle stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --postgres --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames --postgres stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/filenames stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/multiple_schema_mssql/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/multiple_schema_mysql/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/multiple_schema_oracle/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/dbml2sql/multiple_schema_pg/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --mssql --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --mysql --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --mysql --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --mysql stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --postgres --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --postgres --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --postgres stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename --snowflake stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filename stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --mysql --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --mysql --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --mysql stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --postgres --out-file/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --postgres --out-file/out-files/schema.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames --postgres stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/filenames stdout/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/multiple_schema_mssql/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/multiple_schema_mysql/dbml-error.log +0 -0
- /package/{__tests__ → __test__}/sql2dbml/multiple_schema_mysql/out-files/multiple_schema.out.dbml +0 -0
- /package/{__tests__ → __test__}/sql2dbml/multiple_schema_pg/out-files/multiple_schema.out.dbml +0 -0
package/lib/cli/index.js
CHANGED
|
@@ -41,6 +41,7 @@ function db2dbml(args) {
|
|
|
41
41
|
- postgres: 'postgresql://user:password@localhost:5432/dbname?schemas=schema1,schema2,schema3'
|
|
42
42
|
- mysql: 'mysql://user:password@localhost:3306/dbname'
|
|
43
43
|
- mssql: 'Server=localhost,1433;Database=master;User Id=sa;Password=your_password;Encrypt=true;TrustServerCertificate=true;Schemas=schema1,schema2,schema3;'
|
|
44
|
+
- oracle: 'username/password@[//]host[:port][/service_name]'
|
|
44
45
|
- snowflake:
|
|
45
46
|
- password-based authentication: 'SERVER=<account_identifier>.<region>;UID=<your_username>;PWD=<your_password>;DATABASE=<your_database>;WAREHOUSE=<your_warehouse>;ROLE=<your_role>;SCHEMAS=schema1,schema2,schema3;'
|
|
46
47
|
- key pair authentication: 'SERVER=<account_identifier>.<region>;UID=<your_username>;AUTHENTICATOR=SNOWFLAKE_JWT;PRIVATE_KEY_PATH=<path_to_your_private_key.p8>;PASSPHRASE=<your_private_key_passphrase>;DATABASE=<your_database>;WAREHOUSE=<your_warehouse>;ROLE=<your_role>;SCHEMAS=schema1,schema2,schema3;'
|
package/lib/cli/utils.js
CHANGED
|
@@ -38,7 +38,7 @@ function getFormatOpt(opts) {
|
|
|
38
38
|
return format;
|
|
39
39
|
}
|
|
40
40
|
function getConnectionOpt(args) {
|
|
41
|
-
const supportedDatabases = ['postgres', 'mysql', 'mssql', 'snowflake', 'bigquery'];
|
|
41
|
+
const supportedDatabases = ['postgres', 'mysql', 'mssql', 'snowflake', 'bigquery', 'oracle'];
|
|
42
42
|
const defaultConnectionOpt = {
|
|
43
43
|
connection: args[0],
|
|
44
44
|
databaseType: 'unknown'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/cli",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.3.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/cli": "^7.21.0",
|
|
32
|
-
"@dbml/connector": "^5.
|
|
33
|
-
"@dbml/core": "^5.
|
|
32
|
+
"@dbml/connector": "^5.3.1",
|
|
33
|
+
"@dbml/core": "^5.3.1",
|
|
34
34
|
"bluebird": "^3.5.5",
|
|
35
35
|
"chalk": "^2.4.2",
|
|
36
36
|
"commander": "^2.20.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
59
|
"typescript-eslint": "^8.46.3"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "54ca4861d608adbfc17c86d840c2e663e9c428f9",
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=18"
|
|
64
64
|
}
|
package/src/cli/index.js
CHANGED
|
@@ -57,6 +57,7 @@ function db2dbml (args) {
|
|
|
57
57
|
- postgres: 'postgresql://user:password@localhost:5432/dbname?schemas=schema1,schema2,schema3'
|
|
58
58
|
- mysql: 'mysql://user:password@localhost:3306/dbname'
|
|
59
59
|
- mssql: 'Server=localhost,1433;Database=master;User Id=sa;Password=your_password;Encrypt=true;TrustServerCertificate=true;Schemas=schema1,schema2,schema3;'
|
|
60
|
+
- oracle: 'username/password@[//]host[:port][/service_name]'
|
|
60
61
|
- snowflake:
|
|
61
62
|
- password-based authentication: 'SERVER=<account_identifier>.<region>;UID=<your_username>;PWD=<your_password>;DATABASE=<your_database>;WAREHOUSE=<your_warehouse>;ROLE=<your_role>;SCHEMAS=schema1,schema2,schema3;'
|
|
62
63
|
- key pair authentication: 'SERVER=<account_identifier>.<region>;UID=<your_username>;AUTHENTICATOR=SNOWFLAKE_JWT;PRIVATE_KEY_PATH=<path_to_your_private_key.p8>;PASSPHRASE=<your_private_key_passphrase>;DATABASE=<your_database>;WAREHOUSE=<your_warehouse>;ROLE=<your_role>;SCHEMAS=schema1,schema2,schema3;'
|
package/src/cli/utils.js
CHANGED
|
@@ -34,7 +34,7 @@ function getFormatOpt (opts) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function getConnectionOpt (args) {
|
|
37
|
-
const supportedDatabases = ['postgres', 'mysql', 'mssql', 'snowflake', 'bigquery'];
|
|
37
|
+
const supportedDatabases = ['postgres', 'mysql', 'mssql', 'snowflake', 'bigquery', 'oracle'];
|
|
38
38
|
const defaultConnectionOpt = {
|
|
39
39
|
connection: args[0],
|
|
40
40
|
databaseType: 'unknown',
|
package/yarn-error.log
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Arguments:
|
|
2
|
+
/usr/local/bin/node /usr/local/bin/yarn install
|
|
3
|
+
|
|
4
|
+
PATH:
|
|
5
|
+
/opt/homebrew/opt/openjdk/bin:/opt/homebrew/opt/postgresql@13/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/opt/postgresql@13/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/nguyenhoang/.cargo/bin
|
|
6
|
+
|
|
7
|
+
Yarn version:
|
|
8
|
+
1.22.18
|
|
9
|
+
|
|
10
|
+
Node version:
|
|
11
|
+
16.18.0
|
|
12
|
+
|
|
13
|
+
Platform:
|
|
14
|
+
darwin arm64
|
|
15
|
+
|
|
16
|
+
Trace:
|
|
17
|
+
SyntaxError: /Users/nguyenhoang/Documents/workspace/dbx/dbml/package.json: Unexpected token } in JSON at position 130
|
|
18
|
+
at JSON.parse (<anonymous>)
|
|
19
|
+
at /usr/local/lib/node_modules/yarn/lib/cli.js:1625:59
|
|
20
|
+
at Generator.next (<anonymous>)
|
|
21
|
+
at step (/usr/local/lib/node_modules/yarn/lib/cli.js:310:30)
|
|
22
|
+
at /usr/local/lib/node_modules/yarn/lib/cli.js:321:13
|
|
23
|
+
|
|
24
|
+
npm manifest:
|
|
25
|
+
{
|
|
26
|
+
"name": "@dbml/cli",
|
|
27
|
+
"version": "2.5.3",
|
|
28
|
+
"description": "",
|
|
29
|
+
"main": "lib/index.js",
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "jest",
|
|
33
|
+
"build": "babel src --out-dir lib --copy-files",
|
|
34
|
+
"prepublish": "npm run build"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"bin": {
|
|
40
|
+
"dbml2sql": "bin/dbml2sql.js",
|
|
41
|
+
"sql2dbml": "bin/sql2dbml.js"
|
|
42
|
+
},
|
|
43
|
+
"author": "Holistics <dev@holistics.io>",
|
|
44
|
+
"homepage": "https://dbml.dbdiagram.io",
|
|
45
|
+
"repository": "https://github.com/holistics/dbml/tree/master/packages/dbml-cli",
|
|
46
|
+
"keywords": [
|
|
47
|
+
"dbml",
|
|
48
|
+
"dbml-cli"
|
|
49
|
+
],
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@babel/cli": "^7.21.0",
|
|
52
|
+
"@dbml/core": "^2.5.3",
|
|
53
|
+
"bluebird": "^3.5.5",
|
|
54
|
+
"chalk": "^2.4.2",
|
|
55
|
+
"commander": "^2.20.0",
|
|
56
|
+
"esm": "^3.2.25",
|
|
57
|
+
"figures": "^3.2.0",
|
|
58
|
+
"lodash": "^4.17.15",
|
|
59
|
+
"pegjs-require-import": "^0.0.2",
|
|
60
|
+
"strip-ansi": "^5.2.0",
|
|
61
|
+
"winston": "^3.2.1"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@babel/core": "^7.21.4",
|
|
65
|
+
"@babel/node": "^7.20.7",
|
|
66
|
+
"@babel/plugin-transform-runtime": "^7.21.4",
|
|
67
|
+
"@babel/preset-env": "^7.21.4",
|
|
68
|
+
"@babel/runtime": "^7.21.0",
|
|
69
|
+
"babel-jest": "^29.5.0",
|
|
70
|
+
"jest": "^29.5.0"
|
|
71
|
+
},
|
|
72
|
+
"jest": {
|
|
73
|
+
"setupFiles": [
|
|
74
|
+
"./jestHelpers.js"
|
|
75
|
+
],
|
|
76
|
+
"transform": {
|
|
77
|
+
"^.+\\.js$": "babel-jest"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"gitHead": "5cb80e1aa38fb9a4dbe3079e39c9ef93cd4dc556"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
yarn manifest:
|
|
84
|
+
No manifest
|
|
85
|
+
|
|
86
|
+
Lockfile:
|
|
87
|
+
No lockfile
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
2025-11-17T14:38:14.793Z
|
|
2
|
-
ConnectionError: Failed to connect to localhost:1433 - Could not connect (sequence)
|
|
3
|
-
at /home/huydna/projects/dbml/node_modules/mssql/lib/tedious/connection-pool.js:85:17
|
|
4
|
-
at Connection.onConnect (/home/huydna/projects/dbml/node_modules/tedious/lib/connection.js:849:9)
|
|
5
|
-
at Object.onceWrapper (node:events:633:26)
|
|
6
|
-
at Connection.emit (node:events:518:28)
|
|
7
|
-
at Connection.emit (/home/huydna/projects/dbml/node_modules/tedious/lib/connection.js:970:18)
|
|
8
|
-
at Connection.socketError (/home/huydna/projects/dbml/node_modules/tedious/lib/connection.js:1351:12)
|
|
9
|
-
at /home/huydna/projects/dbml/node_modules/tedious/lib/connection.js:1144:14
|
|
10
|
-
at process.processTicksAndRejections (node:internal/process/task_queues:85:11)
|
|
11
|
-
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
Table "dbo"."users" {
|
|
2
|
-
"user_id" int(10) [pk, not null, increment]
|
|
3
|
-
"username" varchar(50) [unique, not null]
|
|
4
|
-
"email" varchar(100) [unique, not null, check: `[email] like '%_@_%._%'`]
|
|
5
|
-
"password_hash" varchar(255) [not null]
|
|
6
|
-
"first_name" varchar(50)
|
|
7
|
-
"last_name" varchar(50)
|
|
8
|
-
"full_name" varchar(100)
|
|
9
|
-
"full_name_lower" varchar(100)
|
|
10
|
-
"date_of_birth" date [check: `[date_of_birth]<=dateadd(year,(-13),getdate())`]
|
|
11
|
-
"created_at" datetime2 [default: `getdate()`]
|
|
12
|
-
"last_login" datetime2
|
|
13
|
-
"is_active" bit [default: 1]
|
|
14
|
-
|
|
15
|
-
Indexes {
|
|
16
|
-
email [type: nonclustered, name: "idx_users_email"]
|
|
17
|
-
full_name [type: nonclustered, name: "idx_users_full_name"]
|
|
18
|
-
(is_active, full_name_lower) [type: nonclustered, name: "idx_users_is_active_full_name"]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
Table "dbo"."products" {
|
|
23
|
-
"product_id" int(10) [pk, not null, increment]
|
|
24
|
-
"name" varchar(100) [not null]
|
|
25
|
-
"description" text
|
|
26
|
-
"price" decimal(10,2) [not null, check: `[price]>(0)`]
|
|
27
|
-
"stock_quantity" int(10) [not null, check: `[stock_quantity]>=(0)`, default: 0]
|
|
28
|
-
"category" varchar(50)
|
|
29
|
-
"created_at" datetime2 [default: `getdate()`]
|
|
30
|
-
"updated_at" datetime2 [default: `getdate()`]
|
|
31
|
-
"is_available" bit [default: 1]
|
|
32
|
-
|
|
33
|
-
Indexes {
|
|
34
|
-
category [type: nonclustered, name: "idx_products_category"]
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
Table "dbo"."orders" {
|
|
39
|
-
"order_id" int(10) [pk, not null, increment]
|
|
40
|
-
"user_id" int(10) [not null]
|
|
41
|
-
"order_date" datetime2 [default: `getdate()`]
|
|
42
|
-
"total_amount" decimal(12,2) [not null, check: `[total_amount]>(0)`]
|
|
43
|
-
"status" varchar(20) [check: `[status]='cancelled' OR [status]='delivered' OR [status]='shipped' OR [status]='processing' OR [status]='pending'`, default: 'pending']
|
|
44
|
-
"shipping_address" text [not null]
|
|
45
|
-
"billing_address" text [not null]
|
|
46
|
-
|
|
47
|
-
Indexes {
|
|
48
|
-
(user_id, order_date) [type: nonclustered, name: "idx_orders_user_date"]
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
Table "dbo"."order_items" {
|
|
53
|
-
"order_item_id" int(10) [pk, not null, increment]
|
|
54
|
-
"order_id" int(10) [unique, not null]
|
|
55
|
-
"product_id" int(10) [unique, not null]
|
|
56
|
-
"quantity" int(10) [not null, check: `[quantity]>(0)`]
|
|
57
|
-
"unit_price" decimal(10,2) [not null, check: `[unit_price]>(0)`]
|
|
58
|
-
|
|
59
|
-
Indexes {
|
|
60
|
-
(order_id, product_id) [type: nonclustered, name: "idx_order_items_order_product"]
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
Table "dbo"."StringTypes" {
|
|
65
|
-
"Id" int(10) [pk, not null, increment]
|
|
66
|
-
"CharField" char(10) [default: 'N/A']
|
|
67
|
-
"VarcharField" varchar(50) [default: '{"default_key": "default_value"}']
|
|
68
|
-
"VarcharMaxField" varchar(MAX) [default: 'N/A']
|
|
69
|
-
"TextField" text [default: 'N/A']
|
|
70
|
-
"NCharField" nchar(10) [default: `N'N/A'`]
|
|
71
|
-
"NVarCharField" nvarchar(50) [default: `N'N/A'`]
|
|
72
|
-
"NVarCharMaxField" nvarchar(MAX) [default: `N'N/A'`]
|
|
73
|
-
"NTextField" ntext [default: `N'N/A'`]
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
Table "dbo"."NumberTypes" {
|
|
77
|
-
"ID" int(10) [pk, not null, increment]
|
|
78
|
-
"TINYINTCol" tinyint(3) [default: 0]
|
|
79
|
-
"SMALLINTCol" smallint(5) [default: 0]
|
|
80
|
-
"INTCol" int(10) [default: 0]
|
|
81
|
-
"BIGINTCol" bigint(19) [default: 0]
|
|
82
|
-
"DECIMALCol" decimal(10,2) [default: 0.00]
|
|
83
|
-
"NUMERICCol" numeric(10,2) [default: 0.00]
|
|
84
|
-
"FLOATCol" float(53) [default: 0.0]
|
|
85
|
-
"REALCol" real(24) [default: 0.0]
|
|
86
|
-
"BITCol" bit [default: 0]
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
Table "dbo"."NumberTypesNoDefault" {
|
|
90
|
-
"ID" int(10) [pk, not null, increment]
|
|
91
|
-
"TINYINTCol" tinyint(3)
|
|
92
|
-
"SMALLINTCol" smallint(5)
|
|
93
|
-
"INTCol" int(10)
|
|
94
|
-
"BIGINTCol" bigint(19)
|
|
95
|
-
"DECIMALCol" decimal(10,2)
|
|
96
|
-
"NUMERICCol" numeric(10,2)
|
|
97
|
-
"FLOATCol" float(53)
|
|
98
|
-
"REALCol" real(24)
|
|
99
|
-
"BITCol" bit
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
Table "dbo"."DatetimeTypes" {
|
|
103
|
-
"ID" int(10) [pk, not null, increment]
|
|
104
|
-
"DATECol" date [default: `getdate()`]
|
|
105
|
-
"TIMECol" time [default: `CONVERT([time],getdate())`]
|
|
106
|
-
"DATETIMECol" datetime [default: `getdate()`]
|
|
107
|
-
"DATETIME2Col" datetime2 [default: `sysdatetime()`]
|
|
108
|
-
"SMALLDATETIMECol" smalldatetime [default: `getdate()`]
|
|
109
|
-
"ROWVERSIONCol" timestamp [not null]
|
|
110
|
-
"DATETIMEOFFSETCol" datetimeoffset [default: `sysdatetimeoffset()`]
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
Table "dbo"."ObjectTypes" {
|
|
114
|
-
"Id" int(10) [pk, not null, increment]
|
|
115
|
-
"XmlField" xml [default: '''<Books>
|
|
116
|
-
<Book>
|
|
117
|
-
<Title>The Great Gatsby</Title>
|
|
118
|
-
<Author>F. Scott Fitzgerald</Author>
|
|
119
|
-
<Year>1925</Year>
|
|
120
|
-
<Price>10.99</Price>
|
|
121
|
-
<Publisher>Scribner</Publisher>
|
|
122
|
-
<Location>New York</Location>
|
|
123
|
-
<Genre>Fiction</Genre>
|
|
124
|
-
<Subgenre>Classic</Subgenre>
|
|
125
|
-
</Book>
|
|
126
|
-
<Book>
|
|
127
|
-
<Title>1984</Title>
|
|
128
|
-
<Author>George Orwell</Author>
|
|
129
|
-
<Year>1949</Year>
|
|
130
|
-
<Price>8.99</Price>
|
|
131
|
-
<Publisher>Secker & Warburg</Publisher>
|
|
132
|
-
<Location>London</Location>
|
|
133
|
-
<Genre>Dystopian</Genre>
|
|
134
|
-
<Subgenre>Political Fiction</Subgenre>
|
|
135
|
-
</Book>
|
|
136
|
-
</Books>''']
|
|
137
|
-
"JsonField" nvarchar(MAX) [default: `N'{"defaultKey": "defaultValue", "status": "active", "count": 0}'`]
|
|
138
|
-
"BinaryField" binary(50) [default: `0x00`]
|
|
139
|
-
"VarBinaryField" varbinary(50) [default: `0x00`]
|
|
140
|
-
"VarBinaryMaxField" varbinary(MAX) [default: `0x00`]
|
|
141
|
-
"ImageField" image [default: `0x00`]
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
Table "dbo"."gender_reference" {
|
|
145
|
-
"value" nvarchar(10) [pk, not null]
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
Table "dbo"."user_define_data_types" {
|
|
149
|
-
"id" int(10) [pk, not null, increment]
|
|
150
|
-
"name" nvarchar(50)
|
|
151
|
-
"gender" nvarchar(10) [check: `[gender]='Other' OR [gender]='Female' OR [gender]='Male'`]
|
|
152
|
-
"age_start" int(10)
|
|
153
|
-
"age_end" int(10)
|
|
154
|
-
"height" float(53)
|
|
155
|
-
"weight" float(53)
|
|
156
|
-
|
|
157
|
-
Checks {
|
|
158
|
-
`[age_start]<=[age_end]` [name: 'chk_age_range']
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
Table "dbo"."table_with_comments" {
|
|
163
|
-
"id" int(10) [pk, not null, increment, note: 'Unique identifier for each item.']
|
|
164
|
-
"name" varchar(100) [note: 'Name of the item.']
|
|
165
|
-
"description" text [note: '''Item\'s description''']
|
|
166
|
-
"created_at" datetime2 [default: `getdate()`, note: 'Timestamp when the item was created.']
|
|
167
|
-
Note: 'This table stores information about various items.'
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
Table "dbo"."Authors" {
|
|
171
|
-
"AuthorID" int(10) [pk, not null]
|
|
172
|
-
"NationalityID" int(10) [pk, not null]
|
|
173
|
-
"AuthorName" nvarchar(100) [unique]
|
|
174
|
-
"BirthYear" int(10) [unique]
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
Table "dbo"."Books" {
|
|
178
|
-
"BookID" int(10) [pk, not null]
|
|
179
|
-
"AuthorID" int(10) [pk, not null]
|
|
180
|
-
"NationalityID" int(10)
|
|
181
|
-
"ISBN" nvarchar(20) [unique]
|
|
182
|
-
"Title" nvarchar(200)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
Table "dbo"."AddressInfo" {
|
|
186
|
-
"AddressID" uniqueidentifier(16) [not null]
|
|
187
|
-
"AddressFormatID" uniqueidentifier(16) [not null]
|
|
188
|
-
|
|
189
|
-
Checks {
|
|
190
|
-
`([AddressID]='176029FA-D6D3-49E1-A48C-000000000002' OR [AddressID]='176029FA-D6D3-49E1-A48C-000000000001') AND ([AddressFormatID]='176029FA-D6D3-49E1-A48C-000000000002' OR [AddressFormatID]='176029FA-D6D3-49E1-A48C-000000000001')` [name: 'CK_Address_Valid']
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
Table "dbo"."AddressInfo2" {
|
|
195
|
-
"A1" uniqueidentifier(16) [not null]
|
|
196
|
-
"A2" uniqueidentifier(16) [not null]
|
|
197
|
-
"A3" uniqueidentifier(16) [not null]
|
|
198
|
-
"A4" uniqueidentifier(16) [not null]
|
|
199
|
-
|
|
200
|
-
Checks {
|
|
201
|
-
`([A1]='333' OR [A1]='2222' OR [A1]='1111') AND ([A2]='2222' OR [A2]='1111') AND ([A3]='1111' OR [A3]='2222') AND ([A4]='3333' OR [A4]='2222')` [name: 'CK_Address_Valid2']
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
Table "dbo"."TestDescriptionTable" {
|
|
206
|
-
"Id" int(10) [note: 'Primary key identifier.']
|
|
207
|
-
"Name" nvarchar(100) [check: `len([Name])>(6)`, note: 'Name of the entity.']
|
|
208
|
-
Note: 'This is the custom comment name on table.'
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
Ref "FK_AuthorNationality":"dbo"."Authors".("AuthorID", "NationalityID") < "dbo"."Books".("AuthorID", "NationalityID")
|
|
212
|
-
|
|
213
|
-
Ref "fk_product":"dbo"."products"."product_id" < "dbo"."order_items"."product_id" [update: cascade]
|
|
214
|
-
|
|
215
|
-
Ref "fk_order":"dbo"."orders"."order_id" < "dbo"."order_items"."order_id" [update: cascade, delete: cascade]
|
|
216
|
-
|
|
217
|
-
Ref "fk_user":"dbo"."users"."user_id" < "dbo"."orders"."user_id" [update: cascade, delete: cascade]
|
|
218
|
-
|
|
219
|
-
Ref "fk_gender":"dbo"."gender_reference"."value" < "dbo"."user_define_data_types"."gender"
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
Enum "status_example_2_s1_enum" {
|
|
2
|
-
"active"
|
|
3
|
-
"inactive"
|
|
4
|
-
"pending"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
Enum "status_example_2_s2_enum" {
|
|
8
|
-
"active"
|
|
9
|
-
"inactive"
|
|
10
|
-
"pending"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
Enum "status_example_2_s3_enum" {
|
|
14
|
-
"active"
|
|
15
|
-
"inactive"
|
|
16
|
-
"pending"
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
Enum "status_example_2_s4_enum" {
|
|
20
|
-
"active"
|
|
21
|
-
"inactive"
|
|
22
|
-
"pending"
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Enum "status_example_2_s5_enum" {
|
|
26
|
-
"0"
|
|
27
|
-
"1"
|
|
28
|
-
"2"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
Enum "status_example_2_s6_enum" {
|
|
32
|
-
"0"
|
|
33
|
-
"1"
|
|
34
|
-
"2"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
Enum "status_example_2_s7_enum" {
|
|
38
|
-
"0"
|
|
39
|
-
"1"
|
|
40
|
-
"2"
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
Enum "status_example_2_s8_enum" {
|
|
44
|
-
"0"
|
|
45
|
-
"1"
|
|
46
|
-
"2"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Table "categories" {
|
|
50
|
-
"cat_id" "int unsigned" [pk, not null, increment]
|
|
51
|
-
"cat_name" varchar(50) [not null]
|
|
52
|
-
"super_cat_id" "int unsigned"
|
|
53
|
-
"created_at" timestamp [default: `CURRENT_TIMESTAMP`]
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
Table "composite_key_1" {
|
|
57
|
-
"id1_1" "int unsigned" [not null]
|
|
58
|
-
"id1_2" "int unsigned" [not null]
|
|
59
|
-
"email" varchar(255)
|
|
60
|
-
"name" varchar(50)
|
|
61
|
-
|
|
62
|
-
Indexes {
|
|
63
|
-
(id1_1, id1_2) [pk, name: "PRIMARY"]
|
|
64
|
-
(email, name) [unique, name: "uc_unique_composite"]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
Table "composite_key_2" {
|
|
69
|
-
"id2_1" "int unsigned" [not null]
|
|
70
|
-
"id2_2" "int unsigned" [not null]
|
|
71
|
-
|
|
72
|
-
Indexes {
|
|
73
|
-
(id2_1, id2_2) [pk, name: "PRIMARY"]
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
Table "date_time_example" {
|
|
78
|
-
"default_now" timestamp [default: `CURRENT_TIMESTAMP`]
|
|
79
|
-
"default_local" timestamp [default: `CURRENT_TIMESTAMP`]
|
|
80
|
-
"date_plus_7_days" date [default: `(curdate() + interval 7 day)`]
|
|
81
|
-
"date_minus_30_days" date [default: `(curdate() - interval 30 day)`]
|
|
82
|
-
"timestamp_plus_1_hour" timestamp [default: `(now() + interval 1 hour)`]
|
|
83
|
-
"timestamp_minus_15_minutes" timestamp [default: `(now() - interval 15 minute)`]
|
|
84
|
-
"on_update_1" "datetime on update CURRENT_TIMESTAMP" [default: `CURRENT_TIMESTAMP`]
|
|
85
|
-
"on_update_2" "datetime on update CURRENT_TIMESTAMP" [default: `CURRENT_TIMESTAMP`]
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
Table "default_example" {
|
|
89
|
-
"id" int [pk, not null, increment]
|
|
90
|
-
"column1" varchar(255) [default: `concat(_utf8mb4\'default \',uuid())`]
|
|
91
|
-
"column2" varchar(255) [default: `concat(_utf8mb4\'random \',floor((rand() * 100)))`]
|
|
92
|
-
"column3" varchar(255) [default: '_utf8mb4']
|
|
93
|
-
"column4" double [default: 0.5]
|
|
94
|
-
"created_date" date [default: `curdate()`]
|
|
95
|
-
"first_date" date [default: '2023-01-01']
|
|
96
|
-
"event_time" timestamp [default: '2024-01-01 00:00:00']
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
Table "hash_index_example" {
|
|
100
|
-
"id" int [pk, not null, note: 'unique identifier for each record']
|
|
101
|
-
"name" varchar(100) [note: '''first name\'s of the individual''']
|
|
102
|
-
"name1" varchar(100) [note: '''last name\'s of the individual''']
|
|
103
|
-
|
|
104
|
-
Indexes {
|
|
105
|
-
(name, name1) [type: hash, name: "idx_name_name1"]
|
|
106
|
-
}
|
|
107
|
-
Note: 'table for storing names with a hash index'
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
Table "index_example" {
|
|
111
|
-
"id" int [pk, not null, increment]
|
|
112
|
-
"name_lower" varchar(100) [not null]
|
|
113
|
-
"name_inline" varchar(100) [not null]
|
|
114
|
-
"email" varchar(100) [unique, not null]
|
|
115
|
-
"age" int
|
|
116
|
-
"city" varchar(50)
|
|
117
|
-
|
|
118
|
-
Indexes {
|
|
119
|
-
(city, age) [type: btree, name: "idx_city_age"]
|
|
120
|
-
`city(5)` [type: btree, name: "idx_city_part"]
|
|
121
|
-
name_inline [type: btree, name: "idx_name"]
|
|
122
|
-
`lower(name_lower)` [type: btree, name: "idx_name_lower"]
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
Table "order_items" {
|
|
127
|
-
"order_id" "int unsigned" [not null]
|
|
128
|
-
"product_id" "int unsigned" [not null]
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
Table "orders" {
|
|
132
|
-
"order_id" "int unsigned" [pk, not null, increment]
|
|
133
|
-
"user_id" "int unsigned"
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
Table "products" {
|
|
137
|
-
"id" "int unsigned" [pk, not null, increment]
|
|
138
|
-
"price" decimal(10,2) [not null]
|
|
139
|
-
"quantity" int [not null, check: ``quantity` < 10000`]
|
|
140
|
-
"total_value" "decimal(10,2) GENERATED ALWAYS AS ((`price` * `quantity`)) STORED" [check: ``total_value` > 0`]
|
|
141
|
-
"updated_at" "timestamp on update CURRENT_TIMESTAMP" [default: `CURRENT_TIMESTAMP`]
|
|
142
|
-
|
|
143
|
-
Checks {
|
|
144
|
-
`(`price` > 0) and (`price` < 1000000)` [name: 'products_chk_1']
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
Table "sqrt_triangle" {
|
|
149
|
-
"side_a" double
|
|
150
|
-
"side_b" double
|
|
151
|
-
"side_c" "double GENERATED ALWAYS AS (sqrt(((`side_a` * `side_a`) + (`side_b` * `side_b`)))) VIRTUAL"
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
Table "status_example_2" {
|
|
155
|
-
"s1" status_example_2_s1_enum [not null]
|
|
156
|
-
"s2" status_example_2_s2_enum
|
|
157
|
-
"s3" status_example_2_s3_enum [default: 'active']
|
|
158
|
-
"s4" status_example_2_s4_enum [default: 'pending']
|
|
159
|
-
"s5" status_example_2_s5_enum
|
|
160
|
-
"s6" status_example_2_s6_enum [not null]
|
|
161
|
-
"s7" status_example_2_s7_enum [default: '1']
|
|
162
|
-
"s8" status_example_2_s8_enum [default: '0']
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
Table "users" {
|
|
166
|
-
"user_id" "int unsigned" [pk, not null, increment]
|
|
167
|
-
"username" varchar(50) [unique, not null]
|
|
168
|
-
"email" varchar(100) [unique, not null]
|
|
169
|
-
"password_hash" varchar(255) [not null]
|
|
170
|
-
"first_name" varchar(50)
|
|
171
|
-
"last_name" varchar(50)
|
|
172
|
-
"date_of_birth" date
|
|
173
|
-
"created_at" timestamp [default: `CURRENT_TIMESTAMP`]
|
|
174
|
-
"last_login" timestamp [default: `CURRENT_TIMESTAMP`]
|
|
175
|
-
"is_active" tinyint(1) [default: 1]
|
|
176
|
-
|
|
177
|
-
Checks {
|
|
178
|
-
``created_at` <= `last_login`` [name: 'chk_last_login']
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
Ref "fk_test_composite":"composite_key_2".("id2_1", "id2_2") < "composite_key_1".("id1_1", "id1_2")
|
|
183
|
-
|
|
184
|
-
Ref "fk_detail_items_orders":"orders"."order_id" < "order_items"."order_id" [delete: cascade]
|
|
185
|
-
|
|
186
|
-
Ref "fk_detail_items_products":"products"."id" < "order_items"."product_id"
|
|
187
|
-
|
|
188
|
-
Ref "fk_order_user":"users"."user_id" < "orders"."user_id" [delete: set null]
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
2025-11-17T14:38:16.383Z
|
|
2
|
-
Error: PostgreSQL connection error: AggregateError
|
|
3
|
-
at getValidatedClient (/home/huydna/projects/dbml/packages/dbml-connector/dist/connectors/postgresConnector.js:21:19)
|
|
4
|
-
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
|
|
5
|
-
at async fetchSchemaJson (/home/huydna/projects/dbml/packages/dbml-connector/dist/connectors/postgresConnector.js:482:20)
|
|
6
|
-
at async connectionHandler (/home/huydna/projects/dbml/packages/dbml-cli/lib/cli/connector.js:24:24)
|
|
7
|
-
|