Hi there! New to this channel so please redirect m...
# prisma-client
a
Hi there! New to this channel so please redirect me if this should go elsewhere. I'm using prisma with a mysql planetscale backend. I'm getting an error about ROW_NUMBER() in a
prisma.$queryRaw
Something like this, which works fine on my planetscale console:
Copy code
const query = `select ROW_NUMBER() over() FROM contacts`;
Results in the error:
Copy code
Code: `1105`. Message: `unknown error: syntax error at position 26`
Anyone know why prisma can't seem to handle
ROW_NUMBER()
function?
👀 1
✅ 1
r
Hi @Ashe Magalhaes 👋 Can you please share the exact query you wrote in
queryRaw
?
a
Hey there, this is the query:
select ROW_NUMBER() over() FROM contacts
Bumping this @Raphael Etim
r
Hi @Ashe Magalhaes, I'll take a look at this today and revert.
Hi @Ashe Magalhaes, Which version of mysql are you using?
From my research the row_number() function is supported from version 8.0 of Mysql server, if your version is below 8.0, it won't work.
If your version is below 8.0, you can emulate it using this link as an example.
a
how do we specify mysql version in prisma schema? I just have
Copy code
datasource db {
  provider             = "mysql"
  url                  = env("DATABASE_URL")
  referentialIntegrity = "prisma"
}
n
Moving conversation to #orm-help