Skip to content

Commit

Permalink
[DPCP-37]: Prisma Accelerator (#7)
Browse files Browse the repository at this point in the history
* ar(feat) DPCP-37: Prisma Accelerator

* ar(feat) DPCP-37: Prisma Accelerator

* ar(feat) DPCP-37: Prisma Accelerator

* ar(feat) DPCP-37: Prisma Accelerator

* ar(feat) DPCP-37: Prisma Accelerator

* ar(feat) DPCP-37: Prisma Accelerator

* ar(feat) DPCP-37: Prisma Accelerator
  • Loading branch information
angeloreale authored Jul 13, 2024
1 parent f04a5c4 commit 6a68207
Show file tree
Hide file tree
Showing 10 changed files with 2,155 additions and 987 deletions.
4 changes: 3 additions & 1 deletion .env.public
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
# or add it to you ci environment

MONGODB_PRIVATE_URI=""
MONGODB_PUBLIC_URI=""
MONGODB_PUBLIC_URI=""
PRISMA_PRIVATE_URI=""
PRISMA_PUBLIC_URI=""
9 changes: 7 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#npm run format:fix
#npm run build
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run format:fix
# npm run build
git add .
# git commit -m "husky(lint)"
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
5 changes: 3 additions & 2 deletions 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 { PrismaClient as PrivatePrisma } from '@dreampipcom/db-private/prisma-client/edge';
import { withAccelerate } from '@prisma/extension-accelerate';

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

declare const globalThis: {
Expand Down
5 changes: 3 additions & 2 deletions 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 { PrismaClient as PublicPrisma } from '@dreampipcom/db-public/prisma-client/edge';
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 6a68207

Please sign in to comment.