Skip to content

Commit

Permalink
fix(be): Update apps/backend/src/modules/prisma/prisma.service.ts
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
krystxf and coderabbitai[bot] committed Oct 27, 2024
1 parent c24bde6 commit 7403d00
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions apps/backend/src/modules/prisma/prisma.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@ export class PrismaService

async getExtensions(): Promise<
{
oid: string | number;
oid: number;
extname: string;
}[]
> {
return await this.$queryRaw`SELECT * FROM pg_extension`;
try {
return await this.$queryRaw`
SELECT oid::integer as oid, extname
FROM pg_extension
`;
} catch (error) {
throw new Error(
`Failed to fetch database extensions: ${error.message}`,
);
}
}

async getExtensionNames(): Promise<string[]> {
Expand Down

0 comments on commit 7403d00

Please sign in to comment.