feat: add access db instance in function

This commit is contained in:
Innei
2022-06-10 22:14:04 +08:00
parent 5213455f8a
commit 698656e394

View File

@@ -245,6 +245,9 @@ export class ServerlessService {
db: this.mockDb(
`${model.reference || '#########debug######'}@${model.name}`,
),
dangerousAccessDbInstance: () => {
return this.databaseService.db
},
},
model,
@@ -359,16 +362,15 @@ export class ServerlessService {
],
}
}
private convertTypescriptCode(code: string) {
return transformAsync(code, this.getBabelOptions()).then((res) => {
if (!res) {
throw new InternalServerErrorException('convert code error')
}
console.debug(res.code)
return res.code
})
private async convertTypescriptCode(
code: string,
): Promise<string | null | undefined> {
const res = await transformAsync(code, this.getBabelOptions())
if (!res) {
throw new InternalServerErrorException('convert code error')
}
console.debug(res.code)
return res.code
}
private requireModuleIdSet = new Set<string>()