feat(qc): add support for SQL NOW() function
Opening this for some early feedback, my end goal is to be able to use the database timestamps when running UPDATE commands. I know that there is an issue for this on the Prisma issue tracker, but after searching for almost an hour I gave up trying to find it 😓 Searching for "now" gives a ton of results...
Our code is litered with $executeRaw with something like: UPDATE ... SET "deletedAt" = NOW() WHERE ....
My goal is to be able to replace this with something like:
import { Now } from '@prisma/client'
// ...
await prisma.foobar.update({
where: ...
data: { deletedAt: Now }
})
Any pointers and feedback greatly appreciated! 🙌
Currently stuck on running the tests locally, and unfortunately don't have more time today, will pick up another day!
note to self: I've run . ./.envrc, make dev-postgres13, and are now trying to cargo test -p query-engine-tests
@LinusU try make dev-pg-qc-query instead of make dev-postgres13 if you want to run tests with QC (assuming that's what you want to do based on the PR title). Otherwise, your sequence of steps is correct if you want to run tests with query engine.
CodSpeed Performance Report
Merging #5606 will not alter performance
Comparing LinusU:lu-now (47de924) with main (85179d7)
Summary
✅ 11 untouched benchmarks