Skip to content

upsert() should do ON CONFLICT DO UPDATE/NOTHING in postgresql #9972

Description

@revmischa

The current upsert offered by Prisma has a race condition (#3242). It would be optimal if at least the Postgres/Mysql/Mongodb drivers used the database's native upsert to avoid that.

Originally posted by @windowsdeveloperwannabe in #8134 (comment)

SELECT then INSERT causes race conditions. Postgres has native support for upsert. It's surprising that prisma has a function explicitly named upsert() that doesn't use this feature.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions