-
Notifications
You must be signed in to change notification settings - Fork 5
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
Outbox prisma adapter #231
base: main
Are you sure you want to change the base?
Conversation
9ffbf8c
to
963014a
Compare
const prismaModel: PrismaClient[typeof this.modelName] = this.prisma[this.modelName] | ||
|
||
for (const entry of entries) { | ||
await prismaModel.upsert({ |
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.
upserts often have suboptimal performance with plenty of locking, can we somehow simplify this to be bulk inserts and bulk updates?
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.
Definitely. I'm working on making tests green. Once I cover all cases, Bulk update/insert would do the job.
Actually upsert
has some weird behavior, maybe let's switch to bulk inserts/updates right away.
): Promise<OutboxEntry<SupportedEvents[number]>> { | ||
const prismaModel = this.prisma[this.modelName] as unknown as ModelDelegate | ||
|
||
// @ts-ignore |
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.
TODO: remove it later, added now to just move forward with the CI and setting up tests there.
Transactional outbox pattern adapter for Prisma.