@dbml/cli 3.13.9 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/__test__/db2dbml/mssql/dbml-error.log +636 -0
  2. package/__test__/db2dbml/mssql/out-files/schema.dbml +242 -0
  3. package/__test__/db2dbml/mysql/dbml-error.log +570 -0
  4. package/__test__/db2dbml/mysql/out-files/schema.dbml +180 -0
  5. package/__test__/db2dbml/postgres/dbml-error.log +375 -0
  6. package/__test__/db2dbml/postgres/out-files/schema.dbml +180 -0
  7. package/__test__/dbml2sql/filename --mysql --out-file/out-files/schema.sql +1 -1
  8. package/__test__/dbml2sql/filename --oracle --out-file/out-files/schema.sql +1 -1
  9. package/__test__/dbml2sql/filename --out-file/out-files/schema.sql +1 -1
  10. package/__test__/dbml2sql/filename --postgres --out-file/out-files/schema.sql +1 -1
  11. package/__test__/dbml2sql/filenames --mysql --out-file/out-files/schema.sql +1 -1
  12. package/__test__/dbml2sql/filenames --oracle --out-file/out-files/schema.sql +1 -1
  13. package/__test__/dbml2sql/filenames --out-file/out-files/schema.sql +1 -1
  14. package/__test__/dbml2sql/filenames --postgres --out-file/out-files/schema.sql +1 -1
  15. package/__test__/dbml2sql/multiple_schema_mssql/out-files/multiple_schema.out.sql +1 -1
  16. package/__test__/dbml2sql/multiple_schema_mysql/out-files/multiple_schema.out.sql +1 -1
  17. package/__test__/dbml2sql/multiple_schema_oracle/out-files/multiple_schema.out.sql +1 -1
  18. package/__test__/dbml2sql/multiple_schema_pg/out-files/multiple_schema.out.sql +3 -3
  19. package/__test__/dbml2sql/syntax-error/dbml-error.log +12 -1515
  20. package/__test__/sql2dbml/filename --mssql --out-file/out-files/schema.dbml +3 -3
  21. package/__test__/sql2dbml/filename --snowflake stdout/dbml-error.log +0 -0
  22. package/__test__/sql2dbml/multiple_schema_mssql/out-files/multiple_schema.out.dbml +28 -28
  23. package/__test__/sql2dbml/multiple_schema_pg/dbml-error.log +0 -52
  24. package/__test__/sql2dbml/syntax-error/dbml-error.log +29 -1532
  25. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mssql/dbml-error.log +32 -1593
  26. package/__test__/sql2dbml/syntax-error-duplicate-endpoints --mysql/dbml-error.log +32 -1593
  27. package/dbml-error.log +277 -329
  28. package/lib/cli/index.js +17 -8
  29. package/package.json +4 -4
  30. package/snowflake.log +129 -0
  31. package/src/cli/index.js +18 -9
  32. package/yarn-error.log +0 -87
package/lib/cli/index.js CHANGED
@@ -51,15 +51,24 @@ function db2dbml(args) {
51
51
 
52
52
  - bigquery: /path_to_json_credential.json
53
53
 
54
- For BigQuery, your JSON credential file must contain the following keys:
55
- {
56
- "project_id": "your-project-id",
57
- "client_email": "your-client-email",
58
- "private_key": "your-private-key",
59
- "datasets": ["dataset_1", "dataset_2", ...]
60
- }
54
+ For BigQuery, the credential file supports flexible authentication:
61
55
 
62
- Note: If the "datasets" key is not provided or is an empty array, it will fetch information from all datasets.
56
+ 1. Application Default Credentials (ADC):
57
+ - Empty file: {} - uses environment authentication
58
+ - Override specific fields: {"project_id": "my-project", "datasets": [...]}
59
+
60
+ For more information about ADC, see https://cloud.google.com/docs/authentication/application-default-credentials
61
+
62
+ 2. Explicit Service Account (bypasses ADC):
63
+ {
64
+ "project_id": "your-project-id",
65
+ "client_email": "your-client-email",
66
+ "private_key": "your-private-key",
67
+ "datasets": ["dataset_1", "dataset_2", ...]
68
+ }
69
+ Note: Both client_email and private_key must be provided together.
70
+
71
+ If "datasets" is not specified or is empty, all accessible datasets will be fetched.
63
72
  `;
64
73
  _commander.default.usage('<database-type> <connection-string> [options]').description(description).option('-o, --out-file <pathspec>', 'compile all input files into a single files');
65
74
  showHelp(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbml/cli",
3
- "version": "3.13.9",
3
+ "version": "3.14.0",
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.13.9",
30
- "@dbml/core": "^3.13.9",
29
+ "@dbml/connector": "^3.14.0",
30
+ "@dbml/core": "^3.14.0",
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": "5bd93570d26ccde0a4dac9e8d5f968e7e4d3be42",
58
+ "gitHead": "a3be772822c217e0b8afa975e90fa54b81d38276",
59
59
  "engines": {
60
60
  "node": ">=18"
61
61
  }
package/snowflake.log ADDED
@@ -0,0 +1,129 @@
1
+ {"level":"INFO","message":"[6:14:52.313 PM]: Connecting to GLOBAL Snowflake domain"}
2
+ {"level":"INFO","message":"[6:14:52.317 PM]: Trying to initialize Easy Logging"}
3
+ {"level":"INFO","message":"[6:14:52.319 PM]: No client config file found in default directories"}
4
+ {"level":"INFO","message":"[6:14:52.319 PM]: Easy Logging is disabled as no config has been found"}
5
+ {"level":"INFO","message":"[3:18:47.992 PM]: Connecting to GLOBAL Snowflake domain"}
6
+ {"level":"INFO","message":"[3:18:47.996 PM]: Trying to initialize Easy Logging"}
7
+ {"level":"INFO","message":"[3:18:47.998 PM]: No client config file found in default directories"}
8
+ {"level":"INFO","message":"[3:18:47.999 PM]: Easy Logging is disabled as no config has been found"}
9
+ {"level":"INFO","message":"[2:44:09.684 PM]: Connecting to GLOBAL Snowflake domain"}
10
+ {"level":"INFO","message":"[2:44:09.690 PM]: Trying to initialize Easy Logging"}
11
+ {"level":"INFO","message":"[2:44:09.692 PM]: No client config file found in default directories"}
12
+ {"level":"INFO","message":"[2:44:09.692 PM]: Easy Logging is disabled as no config has been found"}
13
+ {"level":"INFO","message":"[4:26:49.324 PM]: Connecting to GLOBAL Snowflake domain"}
14
+ {"level":"INFO","message":"[4:26:49.327 PM]: Trying to initialize Easy Logging"}
15
+ {"level":"INFO","message":"[4:26:49.329 PM]: No client config file found in default directories"}
16
+ {"level":"INFO","message":"[4:26:49.330 PM]: Easy Logging is disabled as no config has been found"}
17
+ {"level":"INFO","message":"[4:27:05.301 PM]: Connecting to GLOBAL Snowflake domain"}
18
+ {"level":"INFO","message":"[4:27:05.303 PM]: Trying to initialize Easy Logging"}
19
+ {"level":"INFO","message":"[4:27:05.306 PM]: No client config file found in default directories"}
20
+ {"level":"INFO","message":"[4:27:05.306 PM]: Easy Logging is disabled as no config has been found"}
21
+ {"level":"INFO","message":"[4:27:13.459 PM]: Connecting to GLOBAL Snowflake domain"}
22
+ {"level":"INFO","message":"[4:27:13.462 PM]: Trying to initialize Easy Logging"}
23
+ {"level":"INFO","message":"[4:27:13.464 PM]: No client config file found in default directories"}
24
+ {"level":"INFO","message":"[4:27:13.464 PM]: Easy Logging is disabled as no config has been found"}
25
+ {"level":"INFO","message":"[4:27:26.410 PM]: Connecting to GLOBAL Snowflake domain"}
26
+ {"level":"INFO","message":"[4:27:26.413 PM]: Trying to initialize Easy Logging"}
27
+ {"level":"INFO","message":"[4:27:26.415 PM]: No client config file found in default directories"}
28
+ {"level":"INFO","message":"[4:27:26.415 PM]: Easy Logging is disabled as no config has been found"}
29
+ {"level":"INFO","message":"[4:27:42.518 PM]: Connecting to GLOBAL Snowflake domain"}
30
+ {"level":"INFO","message":"[4:27:42.520 PM]: Trying to initialize Easy Logging"}
31
+ {"level":"INFO","message":"[4:27:42.524 PM]: No client config file found in default directories"}
32
+ {"level":"INFO","message":"[4:27:42.524 PM]: Easy Logging is disabled as no config has been found"}
33
+ {"level":"INFO","message":"[4:28:10.030 PM]: Connecting to GLOBAL Snowflake domain"}
34
+ {"level":"INFO","message":"[4:28:10.032 PM]: Trying to initialize Easy Logging"}
35
+ {"level":"INFO","message":"[4:28:10.035 PM]: No client config file found in default directories"}
36
+ {"level":"INFO","message":"[4:28:10.035 PM]: Easy Logging is disabled as no config has been found"}
37
+ {"level":"INFO","message":"[3:47:47.869 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
38
+ {"level":"INFO","message":"[3:47:47.871 PM]: Creating new connection object"}
39
+ {"level":"INFO","message":"[3:50:39.098 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
40
+ {"level":"INFO","message":"[3:50:39.100 PM]: Creating new connection object"}
41
+ {"level":"INFO","message":"[3:51:47.763 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
42
+ {"level":"INFO","message":"[3:51:47.765 PM]: Creating new connection object"}
43
+ {"level":"INFO","message":"[3:52:51.188 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
44
+ {"level":"INFO","message":"[3:52:51.189 PM]: Creating new connection object"}
45
+ {"level":"INFO","message":"[3:53:45.381 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
46
+ {"level":"INFO","message":"[3:53:45.382 PM]: Creating new connection object"}
47
+ {"level":"INFO","message":"[3:53:45.384 PM]: Creating Connection[id: b1dcc16b-b552-4996-a0ee-fbd45e2a275b] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
48
+ {"level":"INFO","message":"[3:53:45.384 PM]: Connection[id: b1dcc16b-b552-4996-a0ee-fbd45e2a275b] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: \"/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8\", private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
49
+ {"level":"INFO","message":"[3:53:45.384 PM]: Connection[id: b1dcc16b-b552-4996-a0ee-fbd45e2a275b] - connection object created successfully."}
50
+ {"level":"INFO","message":"[3:53:45.385 PM]: Connection[id: b1dcc16b-b552-4996-a0ee-fbd45e2a275b] - connecting. Associated Snowflake domain: GLOBAL"}
51
+ {"level":"ERROR","message":"[3:53:45.386 PM]: Connection[id: b1dcc16b-b552-4996-a0ee-fbd45e2a275b] - authentication failed. Error: Error: ENOENT: no such file or directory, open '\"/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8\"'\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/a"}
52
+ {"level":"INFO","message":"[3:54:15.329 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
53
+ {"level":"INFO","message":"[3:54:15.331 PM]: Creating new connection object"}
54
+ {"level":"INFO","message":"[3:54:15.332 PM]: Creating Connection[id: 51c4875c-7f78-4811-8e52-4c611c253542] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
55
+ {"level":"INFO","message":"[3:54:15.332 PM]: Connection[id: 51c4875c-7f78-4811-8e52-4c611c253542] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: /Users/huylm/code/work/dbml/packages/dbml-cli/key.p8, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
56
+ {"level":"INFO","message":"[3:54:15.332 PM]: Connection[id: 51c4875c-7f78-4811-8e52-4c611c253542] - connection object created successfully."}
57
+ {"level":"INFO","message":"[3:54:15.333 PM]: Connection[id: 51c4875c-7f78-4811-8e52-4c611c253542] - connecting. Associated Snowflake domain: GLOBAL"}
58
+ {"level":"INFO","message":"[3:54:15.339 PM]: Connection[id: 51c4875c-7f78-4811-8e52-4c611c253542] - authentication successful using: SNOWFLAKE_JWT"}
59
+ {"level":"INFO","message":"[3:54:15.339 PM]: Trying to initialize Easy Logging"}
60
+ {"level":"INFO","message":"[3:54:15.340 PM]: No client config detected."}
61
+ {"level":"INFO","message":"[3:54:15.341 PM]: No config file path found. Client config will not be used."}
62
+ {"level":"INFO","message":"[3:54:15.341 PM]: Easy Logging is disabled as no config has been found"}
63
+ {"level":"INFO","message":"[3:54:15.342 PM]: Connection[id: 51c4875c-7f78-4811-8e52-4c611c253542] - connected successfully after 9.428709030151367 milliseconds"}
64
+ {"level":"INFO","message":"[3:55:14.152 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
65
+ {"level":"INFO","message":"[3:55:14.154 PM]: Creating new connection object"}
66
+ {"level":"INFO","message":"[3:55:14.156 PM]: Creating Connection[id: 9f57ac79-5c29-4ed7-a84b-988ae9c1e342] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
67
+ {"level":"INFO","message":"[3:55:14.156 PM]: Connection[id: 9f57ac79-5c29-4ed7-a84b-988ae9c1e342] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: /Users/huylm/code/work/dbml/packages/dbml-cli/key.p8.PASSPHRASE=, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
68
+ {"level":"INFO","message":"[3:55:14.157 PM]: Connection[id: 9f57ac79-5c29-4ed7-a84b-988ae9c1e342] - connection object created successfully."}
69
+ {"level":"INFO","message":"[3:55:14.157 PM]: Connection[id: 9f57ac79-5c29-4ed7-a84b-988ae9c1e342] - connecting. Associated Snowflake domain: GLOBAL"}
70
+ {"level":"ERROR","message":"[3:55:14.159 PM]: Connection[id: 9f57ac79-5c29-4ed7-a84b-988ae9c1e342] - authentication failed. Error: Error: ENOENT: no such file or directory, open '/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8.PASSPHRASE='\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authen"}
71
+ {"level":"INFO","message":"[3:55:30.146 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
72
+ {"level":"INFO","message":"[3:55:30.148 PM]: Creating new connection object"}
73
+ {"level":"INFO","message":"[3:55:30.149 PM]: Creating Connection[id: b9b1ced6-4a99-45ab-b337-1b8062a8b1c1] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
74
+ {"level":"INFO","message":"[3:55:30.150 PM]: Connection[id: b9b1ced6-4a99-45ab-b337-1b8062a8b1c1] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: ~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8.PASSPHRASE=, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
75
+ {"level":"INFO","message":"[3:55:30.150 PM]: Connection[id: b9b1ced6-4a99-45ab-b337-1b8062a8b1c1] - connection object created successfully."}
76
+ {"level":"INFO","message":"[3:55:30.150 PM]: Connection[id: b9b1ced6-4a99-45ab-b337-1b8062a8b1c1] - connecting. Associated Snowflake domain: GLOBAL"}
77
+ {"level":"ERROR","message":"[3:55:30.152 PM]: Connection[id: b9b1ced6-4a99-45ab-b337-1b8062a8b1c1] - authentication failed. Error: Error: ENOENT: no such file or directory, open '~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8.PASSPHRASE='\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authe"}
78
+ {"level":"INFO","message":"[3:55:41.874 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
79
+ {"level":"INFO","message":"[3:55:41.876 PM]: Creating new connection object"}
80
+ {"level":"INFO","message":"[3:55:41.877 PM]: Creating Connection[id: 14727e10-9737-45f6-a8c4-ecc1fa1d8f2b] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
81
+ {"level":"INFO","message":"[3:55:41.877 PM]: Connection[id: 14727e10-9737-45f6-a8c4-ecc1fa1d8f2b] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: ~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
82
+ {"level":"INFO","message":"[3:55:41.878 PM]: Connection[id: 14727e10-9737-45f6-a8c4-ecc1fa1d8f2b] - connection object created successfully."}
83
+ {"level":"INFO","message":"[3:55:41.878 PM]: Connection[id: 14727e10-9737-45f6-a8c4-ecc1fa1d8f2b] - connecting. Associated Snowflake domain: GLOBAL"}
84
+ {"level":"ERROR","message":"[3:55:41.880 PM]: Connection[id: 14727e10-9737-45f6-a8c4-ecc1fa1d8f2b] - authentication failed. Error: Error: ENOENT: no such file or directory, open '~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8'\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/au"}
85
+ {"level":"INFO","message":"[3:56:21.800 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
86
+ {"level":"INFO","message":"[3:56:21.801 PM]: Creating new connection object"}
87
+ {"level":"INFO","message":"[3:56:21.802 PM]: Creating Connection[id: bc93ab34-9b42-4938-8c31-9c25024c6b93] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
88
+ {"level":"INFO","message":"[3:56:21.803 PM]: Connection[id: bc93ab34-9b42-4938-8c31-9c25024c6b93] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: \"~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8\", private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
89
+ {"level":"INFO","message":"[3:56:21.803 PM]: Connection[id: bc93ab34-9b42-4938-8c31-9c25024c6b93] - connection object created successfully."}
90
+ {"level":"INFO","message":"[3:56:21.804 PM]: Connection[id: bc93ab34-9b42-4938-8c31-9c25024c6b93] - connecting. Associated Snowflake domain: GLOBAL"}
91
+ {"level":"ERROR","message":"[3:56:21.805 PM]: Connection[id: bc93ab34-9b42-4938-8c31-9c25024c6b93] - authentication failed. Error: Error: ENOENT: no such file or directory, open '\"~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8\"'\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/"}
92
+ {"level":"INFO","message":"[3:56:29.711 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
93
+ {"level":"INFO","message":"[3:56:29.712 PM]: Creating new connection object"}
94
+ {"level":"INFO","message":"[3:56:29.714 PM]: Creating Connection[id: 87d2271d-ca23-4a0e-9fff-c0c2fc548582] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
95
+ {"level":"INFO","message":"[3:56:29.714 PM]: Connection[id: 87d2271d-ca23-4a0e-9fff-c0c2fc548582] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: ~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
96
+ {"level":"INFO","message":"[3:56:29.714 PM]: Connection[id: 87d2271d-ca23-4a0e-9fff-c0c2fc548582] - connection object created successfully."}
97
+ {"level":"INFO","message":"[3:56:29.715 PM]: Connection[id: 87d2271d-ca23-4a0e-9fff-c0c2fc548582] - connecting. Associated Snowflake domain: GLOBAL"}
98
+ {"level":"ERROR","message":"[3:56:29.716 PM]: Connection[id: 87d2271d-ca23-4a0e-9fff-c0c2fc548582] - authentication failed. Error: Error: ENOENT: no such file or directory, open '~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8'\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/au"}
99
+ {"level":"INFO","message":"[3:56:39.522 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
100
+ {"level":"INFO","message":"[3:56:39.524 PM]: Creating new connection object"}
101
+ {"level":"INFO","message":"[3:56:39.525 PM]: Creating Connection[id: 962a5094-38c2-4058-b5e6-4edccc1522d6] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
102
+ {"level":"INFO","message":"[3:56:39.525 PM]: Connection[id: 962a5094-38c2-4058-b5e6-4edccc1522d6] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: ~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
103
+ {"level":"INFO","message":"[3:56:39.526 PM]: Connection[id: 962a5094-38c2-4058-b5e6-4edccc1522d6] - connection object created successfully."}
104
+ {"level":"INFO","message":"[3:56:39.526 PM]: Connection[id: 962a5094-38c2-4058-b5e6-4edccc1522d6] - connecting. Associated Snowflake domain: GLOBAL"}
105
+ {"level":"ERROR","message":"[3:56:39.528 PM]: Connection[id: 962a5094-38c2-4058-b5e6-4edccc1522d6] - authentication failed. Error: Error: ENOENT: no such file or directory, open '~/Users/huylm/code/work/dbml/packages/dbml-cli/key.p8'\n at Object.openSync (node:fs:603:3)\n at Object.readFileSync (node:fs:471:35)\n at loadPrivateKey (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/auth_keypair.js:54:31)\n at AuthKeypair.authenticate (/Users/huylm/code/work/dbml/node_modules/snowflake-sdk/lib/authentication/au"}
106
+ {"level":"INFO","message":"[3:57:02.017 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
107
+ {"level":"INFO","message":"[3:57:02.018 PM]: Creating new connection object"}
108
+ {"level":"INFO","message":"[3:57:02.020 PM]: Creating Connection[id: 42bc0678-0b7e-464e-9c0f-317873103503] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
109
+ {"level":"INFO","message":"[3:57:02.020 PM]: Connection[id: 42bc0678-0b7e-464e-9c0f-317873103503] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: /Users/huylm/code/work/dbml/packages/dbml-cli/key.p8, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
110
+ {"level":"INFO","message":"[3:57:02.020 PM]: Connection[id: 42bc0678-0b7e-464e-9c0f-317873103503] - connection object created successfully."}
111
+ {"level":"INFO","message":"[3:57:02.021 PM]: Connection[id: 42bc0678-0b7e-464e-9c0f-317873103503] - connecting. Associated Snowflake domain: GLOBAL"}
112
+ {"level":"INFO","message":"[3:57:02.027 PM]: Connection[id: 42bc0678-0b7e-464e-9c0f-317873103503] - authentication successful using: SNOWFLAKE_JWT"}
113
+ {"level":"INFO","message":"[3:57:02.028 PM]: Trying to initialize Easy Logging"}
114
+ {"level":"INFO","message":"[3:57:02.029 PM]: No client config detected."}
115
+ {"level":"INFO","message":"[3:57:02.029 PM]: No config file path found. Client config will not be used."}
116
+ {"level":"INFO","message":"[3:57:02.029 PM]: Easy Logging is disabled as no config has been found"}
117
+ {"level":"INFO","message":"[3:57:02.031 PM]: Connection[id: 42bc0678-0b7e-464e-9c0f-317873103503] - connected successfully after 10.33554196357727 milliseconds"}
118
+ {"level":"INFO","message":"[3:57:15.585 PM]: Configuring logger with level: 2, filePath: undefined, additionalLogToConsole: false"}
119
+ {"level":"INFO","message":"[3:57:15.587 PM]: Creating new connection object"}
120
+ {"level":"INFO","message":"[3:57:15.588 PM]: Creating Connection[id: 7ecfbb6b-0f84-4ea2-a5a8-7e5c264d452e] with host: holistics.ap-southeast-2.snowflakecomputing.com, account: holistics, accessUrl: https://holistics.ap-southeast-2.snowflakecomputing.com, user: HOLISTICS_USER, role: undefined, database: TEST_DB, schema: undefined, warehouse: DEMO_WH, proxy was not configured, password is not provided, region: ap-southeast-2, authenticator: SNOWFLAKE_JWT, ocsp mode: FAIL_OPEN, os: darwin, os version: 24.3.0"}
121
+ {"level":"INFO","message":"[3:57:15.588 PM]: Connection[id: 7ecfbb6b-0f84-4ea2-a5a8-7e5c264d452e] additional details: passcode in password is provided, passcode is not provided, private key is not provided, application: undefined, client name: snowflake-sdk, client version: 2.0.3, retry timeout: 300, private key path: /Users/huylm/code/work/dbml/packages/dbml-cli/key.p8, private key pass is not provided, client store temporary credential: false, browser response timeout: 120000"}
122
+ {"level":"INFO","message":"[3:57:15.589 PM]: Connection[id: 7ecfbb6b-0f84-4ea2-a5a8-7e5c264d452e] - connection object created successfully."}
123
+ {"level":"INFO","message":"[3:57:15.589 PM]: Connection[id: 7ecfbb6b-0f84-4ea2-a5a8-7e5c264d452e] - connecting. Associated Snowflake domain: GLOBAL"}
124
+ {"level":"INFO","message":"[3:57:15.596 PM]: Connection[id: 7ecfbb6b-0f84-4ea2-a5a8-7e5c264d452e] - authentication successful using: SNOWFLAKE_JWT"}
125
+ {"level":"INFO","message":"[3:57:15.596 PM]: Trying to initialize Easy Logging"}
126
+ {"level":"INFO","message":"[3:57:15.597 PM]: No client config detected."}
127
+ {"level":"INFO","message":"[3:57:15.598 PM]: No config file path found. Client config will not be used."}
128
+ {"level":"INFO","message":"[3:57:15.598 PM]: Easy Logging is disabled as no config has been found"}
129
+ {"level":"INFO","message":"[3:57:15.599 PM]: Connection[id: 7ecfbb6b-0f84-4ea2-a5a8-7e5c264d452e] - connected successfully after 10.343082904815674 milliseconds"}
package/src/cli/index.js CHANGED
@@ -65,15 +65,24 @@ function db2dbml (args) {
65
65
 
66
66
  - bigquery: /path_to_json_credential.json
67
67
 
68
- For BigQuery, your JSON credential file must contain the following keys:
69
- {
70
- "project_id": "your-project-id",
71
- "client_email": "your-client-email",
72
- "private_key": "your-private-key",
73
- "datasets": ["dataset_1", "dataset_2", ...]
74
- }
75
-
76
- Note: If the "datasets" key is not provided or is an empty array, it will fetch information from all datasets.
68
+ For BigQuery, the credential file supports flexible authentication:
69
+
70
+ 1. Application Default Credentials (ADC):
71
+ - Empty file: {} - uses environment authentication
72
+ - Override specific fields: {"project_id": "my-project", "datasets": [...]}
73
+
74
+ For more information about ADC, see https://cloud.google.com/docs/authentication/application-default-credentials
75
+
76
+ 2. Explicit Service Account (bypasses ADC):
77
+ {
78
+ "project_id": "your-project-id",
79
+ "client_email": "your-client-email",
80
+ "private_key": "your-private-key",
81
+ "datasets": ["dataset_1", "dataset_2", ...]
82
+ }
83
+ Note: Both client_email and private_key must be provided together.
84
+
85
+ If "datasets" is not specified or is empty, all accessible datasets will be fetched.
77
86
  `;
78
87
  program
79
88
  .usage('<database-type> <connection-string> [options]')
package/yarn-error.log DELETED
@@ -1,87 +0,0 @@
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