-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Query Postgres Table with UUID as ID raises error #479
Copy link
Copy link
Closed
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.topic: client typesTypes in Prisma ClientTypes in Prisma Clienttopic: native database types
Description
If I try to query a row from a postgres table with a id of type UUID prisma raises an error.
Postgres version: PostgreSQL 11.1 (Debian 11.1-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
Prisma2 version: 2.0.0-alpha.159
DB Script:
CREATE TABLE public."User"
(
age integer,
name text COLLATE pg_catalog."default" NOT NULL DEFAULT ''::text,
id uuid NOT NULL DEFAULT uuid_generate_v1(),
CONSTRAINT id PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public."User"
OWNER to postgres;Schema:
model User {
id String @default(uuid()) @id
age Int?
name String
post Post[]
}Code:
const MyFunc = async function() {
const MyUser = await photon.users.findOne({where: {id: "936958ea-cb04-11e9-bcba-0242ac110002"},});
console.log(MyUser);
}
MyFunc()Error: Reason: Error in connector: Error querying the database: error serializing parameter 0: cannot convert to or from a Postgres value of type uuid
Queries on same table with findMany() is working perfect.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug/2-confirmedBug has been reproduced and confirmed.Bug has been reproduced and confirmed.kind/bugA reported bug.A reported bug.topic: client typesTypes in Prisma ClientTypes in Prisma Clienttopic: native database types