-
Notifications
You must be signed in to change notification settings - Fork 2.2k
.raw errors on date params w/ Postgres #2533
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.tech/enginesIssue for tech Engines.Issue for tech Engines.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: raw$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Milestone
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.tech/enginesIssue for tech Engines.Issue for tech Engines.tech/typescriptIssue for tech TypeScript.Issue for tech TypeScript.topic: raw$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli$queryRaw(Unsafe) and $executeRaw(Unsafe): https://www.prisma.io/docs/concepts/components/prisma-cli
Bug description
When running a raw SQL query with
prisma.rawand template literal params, I get the error below when querying on timestamp columns:How to reproduce
prisma.raw`select * from table where tzfield=${dateValue}`dateValueI tested with both ISO-formatted date strings and JS Date objects.Expected behavior
The query works and returns the same data as a query not involving timestamp fields.
Environment & setup