Skip to content

Commit

Permalink
ar(feat) DPCP-37: Prisma Accelerator
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Jul 13, 2024
1 parent f04a5c4 commit 3c31779
Show file tree
Hide file tree
Showing 7 changed files with 1,414 additions and 929 deletions.
1 change: 1 addition & 0 deletions lib/model/interfaces/get-public-listings-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const getPublicListings = async ({ page = 0, offset = 0, limit = PAGE_SIZE, filt
const adaptQuery: any = {
skip: page * (limit + offset),
take: limit,
cacheStrategy: { ttl: 90 },
};

if (filters?.length) {
Expand Down
3 changes: 2 additions & 1 deletion lib/model/prisma-private-connector.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { PrismaClient as PrivatePrisma } from '@dreampipcom/db-private/prisma-client';
import { withAccelerate } from '@prisma/extension-accelerate'

const prismaClientSingleton = () => {
return new PrivatePrisma();
return new PrivatePrisma().$extends(withAccelerate());
};

declare const globalThis: {
Expand Down
3 changes: 2 additions & 1 deletion lib/model/prisma-public-connector.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { PrismaClient as PublicPrisma } from '@dreampipcom/db-public/prisma-client';
import { withAccelerate } from '@prisma/extension-accelerate'

const prismaClientSingleton = () => {
return new PublicPrisma();
return new PublicPrisma().$extends(withAccelerate());
};

declare const globalThis: {
Expand Down
Loading

0 comments on commit 3c31779

Please sign in to comment.