test: log
This commit is contained in:
parent
698c325b97
commit
6304c4259a
|
@ -100,9 +100,7 @@ export const miRepository = {
|
|||
const builder = this.createQueryBuilder()
|
||||
.addCommonTableExpression(queryBuilder, this.metadata.tableName, { columnNames })
|
||||
.select('*')
|
||||
.from<ObjectLiteral>(this.metadata.tableName, this.metadata.tableName)
|
||||
.where('1 = 1');
|
||||
console.log(builder.getSql());
|
||||
.from<ObjectLiteral>(this.metadata.tableName, this.metadata.tableName);
|
||||
if (findOptions) {
|
||||
return await builder.setFindOptions(findOptions).getOneOrFail();
|
||||
}
|
||||
|
|
|
@ -243,8 +243,8 @@ export function createPostgresDataSource(config: Config) {
|
|||
},
|
||||
} : false,
|
||||
logging: log,
|
||||
logger: log ? new MyCustomLogger() : undefined,
|
||||
maxQueryExecutionTime: 300,
|
||||
logger: log ? process.env.NODE_ENV === 'test' ? 'advanced-console' : new MyCustomLogger() : undefined,
|
||||
maxQueryExecutionTime: log ? 0 : 300,
|
||||
entities: entities,
|
||||
migrations: ['../../migration/*.js'],
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue