Skip to content

Commit 21e4c5b

Browse files
author
hirsch88
committed
Improve ormconfig loader
1 parent 8167b7a commit 21e4c5b

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/lib/seed/connection.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,10 @@ const indexOfConfigPath = args.indexOf(configParam) + 1;
1515
* Returns a TypeORM database connection for our entity-manager
1616
*/
1717
export const getConnection = async (): Promise<Connection> => {
18-
1918
const ormconfig = (hasConfigPath)
2019
? require(`${args[indexOfConfigPath]}`)
2120
: require(`${runDir}/ormconfig.json`);
21+
ormconfig.logging = logging;
2222

23-
return await createConnection({
24-
type: (ormconfig as any).type as any,
25-
host: (ormconfig as any).host,
26-
port: (ormconfig as any).port,
27-
username: (ormconfig as any).username,
28-
password: (ormconfig as any).password,
29-
database: (ormconfig as any).database,
30-
entities: (ormconfig as any).entities,
31-
logging,
32-
});
23+
return createConnection(ormconfig);
3324
};

0 commit comments

Comments
 (0)