TS2353: Object literal may only specify known properties, and where does not exist in type
Hello everyone! I have an error when trying to create a nested filter.
What could be the problem?
"drizzle-orm": "^0.36.4",
node -v - 20
19 Replies
i have literally the same issue. Already posted here but nobody could help
I use @ts-ignore, bot i lost correct types(((
@moderator who can help me?
@Angelelz I noticed you often respond to messages; maybe you could help?
@chepracio can you try change with: {user to with : {users
actually totally forgot, you cant use nested wheres currently i dont think
I think that you are not allowed to use where in a one relation
Iām doing everything according to the documentation, it works, the issue is only with the types. https://orm.drizzle.team/docs/rqb#select-filters
Drizzle ORM - Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
In the docs example, one post has many comments. However in you code, the userCode has one user. That's why drizzle is trying to alert you via types
The nested where can only filter the user, with the current version of relational queries, you can't filter userCode, which is probably what you intent to do.
I understand you, I'll check how it will work with one to many
I still believe your typing implementation is incorrect. I want to update a field that can be null, but I get an error in the
set
method when trying to assign a value to the field. This is incorrect, as the field can be absent, but it should still be assignable.@Angelelz Hello! Can you tell me if this is a problem or if I am using ORM incorrectly?
put an example in drizzle run
This
š© š¤·āāļø Sorry, I don't understood you
@Darren What do you mean? You don't see the images?
Yes, of course I see the images, but I'm unable to replicate this behaviour, whether a uuid is defined as not null or not it always shows up in a set operation.
So the idea is to go to drizzle.run and recreate the behaviour you see using your code so we can see it happening. And if you can't replicate it then you know it's an issue in your files, probably a rogue import statement of a schema or something.
What is drizzle.run?
https://drizzle.run/wex9jx8o6y419osjgjk5e5qp
There is no error here, but there is one in the code. TypeScript complains about it.
You might have a setup problem with typescript. Make sure you use
"strict": true
in your tsconfig.jsonI use it
@Darren Did you watch?