Skip to content

Commit 38d1555

Browse files
committed
Fix typeorm logging option
1 parent d8556d3 commit 38d1555

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const env = {
5353
password: getOsEnvOptional('TYPEORM_PASSWORD'),
5454
database: getOsEnv('TYPEORM_DATABASE'),
5555
synchronize: toBool(getOsEnvOptional('TYPEORM_SYNCHRONIZE')),
56-
logging: toBool(getOsEnv('TYPEORM_LOGGING')),
56+
logging: getOsEnv('TYPEORM_LOGGING'),
5757
},
5858
graphql: {
5959
enabled: toBool(getOsEnv('GRAPHQL_ENABLED')),

test/utils/database.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import { Connection, createConnection, useContainer } from 'typeorm';
33

44
import { env } from '../../src/env';
55

6+
declare type LoggerOptions = boolean | 'all' | Array<('query' | 'schema' | 'error' | 'warn' | 'info' | 'log' | 'migration')>;
7+
68
export const createDatabaseConnection = async (): Promise<Connection> => {
79
useContainer(Container);
810
const connection = await createConnection({
911
type: env.db.type as any, // See createConnection options for valid types
1012
database: env.db.database,
11-
logging: env.db.logging,
13+
logging: env.db.logging as LoggerOptions,
1214
entities: env.app.dirs.entities,
1315
migrations: env.app.dirs.migrations,
1416
});

0 commit comments

Comments
 (0)