Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/dbml-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
"@babel/preset-env": "^7.21.4",
"@babel/preset-typescript": "^7.24.7",
"@babel/runtime": "^7.21.0",
"@types/better-sqlite3": "^7.6.13",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.16",
"@types/mssql": "^9.1.5",
"@types/node": "^22.2.0",
"@types/oracledb": "^6.9.0",
"@types/pg": "^8.11.6",
"babel-jest": "^29.5.0",
"jest": "^29.7.0",
Expand All @@ -35,9 +37,11 @@
"@google-cloud/bigquery": "^7.9.0",
"@typescript-eslint/eslint-plugin": "^8.30.1",
"@typescript-eslint/parser": "^8.30.1",
"better-sqlite3": "^9.4.3",
Comment thread
HungKNguyen marked this conversation as resolved.
Outdated
"lodash": "^4.17.21",
"mssql": "^11.0.1",
"mysql2": "^3.11.0",
"oracledb": "^6.5.0",
Comment thread
HungKNguyen marked this conversation as resolved.
Outdated
"pg": "^8.12.0",
"snowflake-sdk": "^2.0.3"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/dbml-connector/src/connectors/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { fetchSchemaJson as fetchMssqlSchemaJson } from './mssqlConnector';
import { fetchSchemaJson as fetchMysqlSchemaJson } from './mysqlConnector';
import { fetchSchemaJson as fetchSnowflakeSchemaJson } from './snowflakeConnector';
import { fetchSchemaJson as fetchBigQuerySchemaJson } from './bigqueryConnector';
import { fetchSchemaJson as fetchSqliteSchemaJson } from './sqliteConnector';
import { fetchSchemaJson as fetchOracleSchemaJson } from './oracleConnector';

const fetchSchemaJson = async (connection: string, databaseType: string): Promise<DatabaseSchema> => {
switch (databaseType) {
Expand All @@ -17,6 +19,10 @@ const fetchSchemaJson = async (connection: string, databaseType: string): Promis
return fetchSnowflakeSchemaJson(connection);
case 'bigquery':
return fetchBigQuerySchemaJson(connection);
case 'sqlite':
return fetchSqliteSchemaJson(connection);
case 'oracle':
return fetchOracleSchemaJson(connection);
default:
throw new Error(`Unsupported database type: ${databaseType}`);
}
Expand Down
Loading
Loading