Closed emckay closed 1 day ago
Ah just found in the docs that unique constraints are not supported. Too bad this isn't flagged when electrifying the table. It'd also be nice if the unique index doesn't show up in the prisma generated types, so typescript also blocks this type of query.
My table schema looks like this:
I want to query by slug & account_id:
The code passes the TypeScript type check and is valid in vanilla prisma. But at runtime, the query fails to execute because of a zod validation failure:
Here is a repo with a reproduction based on the
create-electric-app
react repo: https://github.com/emckay/electric-liveUnique-bug-repro