-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: read replica service #2377
Conversation
|
Important Auto Review SkippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
PR Description updated to latest commit (edbc9a9) |
PR Review 🔍
Code feedback:
|
PR Code Suggestions ✨
|
import { env } from '@/env'; | ||
|
||
@Injectable() | ||
export class ReadPrismaService extends PrismaService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example of how will you use it? Assuming we have a new endpoint that fetches EndUser
s, how will you make the query using the read replica?
PR Type
enhancement, bug_fix
Description
ReadPrismaService
to handle database operations using a read replica, enhancing performance and scalability.NotFoundEvaluationError
for more specific error handling in data analytics services.Changes walkthrough 📝
5 files
data-analytics.service.ts
Enhance error handling and add read replica support in
DataAnalyticsService
services/workflows-service/src/data-analytics/data-analytics.service.ts
node:util
andReadPrismaService
.NotFoundEvaluationError
for better error handling.NotFoundEvaluationError
.errors.ts
Define NotFoundEvaluationError for specific rule evaluation errors
services/workflows-service/src/data-analytics/errors.ts
NotFoundEvaluationError
with serializationof
inlineRule
.prisma.module.ts
Update Prisma module to support read replica service
services/workflows-service/src/prisma/prisma.module.ts
ReadPrismaService
based onenvironment.
prisma.read-replica.service.ts
Implement ReadPrismaService for handling read replica operations
services/workflows-service/src/prisma/prisma.read-replica.service.ts
ReadPrismaService
extendingPrismaService
for read replicafunctionality.
prisma.service.ts
Integrate read replica support in PrismaService
services/workflows-service/src/prisma/prisma.service.ts
PrismaService
.2 files
env.ts
Add environment variable for read replica database URL
services/workflows-service/src/env.ts
READ_REPLICA_DATABASE_URL
for configuringdatabase replica URL.
consts.ts
Define constant for Prisma read replica service
services/workflows-service/src/prisma/consts.ts
PRISMA_READ_SERVICE
for read replica serviceidentifier.
2 files
pnpm-lock.yaml
Update dependencies to include Prisma read replicas extension
pnpm-lock.yaml
@prisma/extension-read-replicas
.package.json
Add Prisma read replicas extension to package dependencies
services/workflows-service/package.json
@prisma/extension-read-replicas
to package dependencies.