Skip to content

Commit

Permalink
enable to use postgresql as RDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsuyoshi-Ishikawa committed Sep 5, 2023
1 parent 5ad31db commit 80fe819
Show file tree
Hide file tree
Showing 5 changed files with 999 additions and 1,592 deletions.
5 changes: 4 additions & 1 deletion ormconfig.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { DataSourceOptions, DataSource } from 'typeorm';
import { getRdbDatabaseType } from './src/config/rdb';

const getOrmConfig = () => {
const rdbUri = process.env.RDB_URI;
if (!rdbUri) return;

const dataSourceType = getRdbDatabaseType(rdbUri);

const config: DataSourceOptions = {
type: 'mysql',
type: dataSourceType,
url: rdbUri,
synchronize: false,
logging: false,
Expand Down
Loading

0 comments on commit 80fe819

Please sign in to comment.