Delete limit and offset?
I get Property 'limit' does not exist on type 'Omit<PgDelete<PgTableWithColumns>
const results = await db
.delete(scheduledCalls)
.where(eq(scheduledCalls.queueName, queueName))
.limit(limit)
.offset(offset)
9 Replies
I'm having this same issue! Thanks
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
+1 on this
Use sub query
We're working on implementing
limit
and order by
to mutation queries in MySQL in SQLite, however, PG doesn't have such a feature in its engine.
You can write a raw query that adds limit
to delete in PG but you'll get a runtime error in that caseye that's usually handled with a subquery if u need too
Because of that, PG recommends what Dogge said
delete were id in (whatever query u want)
@Mario564 he was looking for offset too, so wont be possible either on mysql/maridb
as just can use LIMIT
Yeah, offset isn't available in any engine for mutation queries