ORM relation `where` does not exist in type
Can someone help me understand if I'm doing something wrong? The following code (adapted from Query/Select filters gives a 'does not exist' error on
where
:
Object literal may only specify known properties, and 'where' does not exist in type..If schema matters, I have a
user
table, a collection
table with fk (userId) and a item
table with fk (collectionId).
I should note that the query works, so maybe it's lacking proper types?9 Replies
try this
basically you need to import the tables from your schema where ever it may be
I already had them imported with
import * as t from..
, I tried your method of importing (destructuring?) but no luckas far as I know, nested where currently is not supported with queries
on the other hand, you can make it using select, fe
hi @scape , thanks for the response, that's what I thought as well and used inner joins.. however I find this strange since this is clearly documented? https://orm.drizzle.team/docs/rqb#select-filters
Try the callback syntax
Also can you share your schema?
It could be that you're trying to filter on
one
relation. Drizzle doesn't support filtering on a one
relation, it would basically return null.GitHub
[BUG]: Filtering results based on relation content using RQB · Issu...
What version of drizzle-orm are you using? 0.29.1 What version of drizzle-kit are you using? 0.20.4 Describe the Bug There's been a few threads on Discord about it but no solid answer other tha...
Okay I see, I'll watch the issue on github, thanks.
It's not an error. It's the expected result. I just wanted you to see a source.
Yes I got that, sorry if my response was misleading. I meant that I'll be tracking the progress as I've noticed other people requesting improvements to the relational query API.