Using sql.placeholder with limit in creating a prepared query
I am attempting to create a prepared query like this...
It fails to compile with the following message:
How are placeholders suppose to work with limit and offset?
12 Replies
what drizzle version and driver are you using?
i've tried this just now on the latest version with sqlite - no issues
"drizzle-orm": "~0.30.7"
"drizzle-kit": "~0.20.14"
"@planetscale/database": "~1.16.0"
The placeholder examples on the site are not working for me either (https://orm.drizzle.team/docs/rqb#placeholder-in-limit)
Drizzle ORM - Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
yeah, it seems like an issue with type definitions(maybe because implementation differs?)
this is typedef in mysql-core
and this is in sqlite-core
so I think you can file an issue on gh
Nice find
does it work tho? is it just a typescript error or query also doesn't work?
if it's only a TS problem it's pretty easy fix - you could patch it temporarily while waiting for an update
I'm not able to compile it and it's a located in a package that is shared with two other webapps, so I think it has to sucessfully compile in order to output the runtime code in the /dist folder for the apps to use.
you could put
as never
there for now to test itGood idea
BTW, this worked. I still need to record an issue on gh. Time is a commodity that is hard to spend properly.
Issue created: https://github.com/drizzle-team/drizzle-orm/issues/2146
GitHub
[BUG]: Using
sql.placeholder
with limit
and/or offset
for a p...What version of drizzle-orm are you using? 0.30.7 What version of drizzle-kit are you using? 0.20.14 Describe the Bug Given the following code, const database: PlanetScaleDatabase = drizzle(client)...