Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPCP-37]: Prisma Accelerator #7

Merged
merged 7 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading