You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript complains about $nested.column$ syntax in query where clause. #13288
good first issueFor issues. An issue that is a good choice for first-time contributors.releasedtypescriptFor issues and PRs. Things that involve typescript, such as typings and intellisense.
What was unclear/insufficient/not covered in the documentation
TypeScript complains about $nested.column$ syntax in query where clause. Because the where clause is typed as needing to be attributes of the model being queried, this syntax triggers an error since these object keys are not attributes of the model.
If possible: Provide some suggestion on how we can enhance the docs
Maybe this is a bug if it's intended to work but otherwise the documentation seems to be lacking how to resolve this.
Additional context
Issue Template Checklist
Is this issue dialect-specific?
No. This issue is relevant to Sequelize as a whole.
Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ
I don't know.
Would you be willing to resolve this issue by submitting a Pull Request?
Yes, I have the time and I know how to start.
Yes, I have the time but I don't know how to start, I would need guidance.
No, I don't have the time, although I believe I could do it if I had the time...
No, I don't have the time and I wouldn't even know how to start.
This is still an issue. It works if TAttributes is any (type WhereOptions<TAttributes = any>) because attributes there are defined as any but it won't work otherwise.
I have a PR in progress for this #13983
The test added by the previous PR was flawed as the Model did not declare any attributes - it accepted any input by default.
good first issueFor issues. An issue that is a good choice for first-time contributors.releasedtypescriptFor issues and PRs. Things that involve typescript, such as typings and intellisense.
Activity
belisarenata commentedon May 27, 2021
Same problem here. TS indicates No overload match, but works just fine when a ts ignore flag is set to the nested clause as a workaround:

Also, at Sequelize V.5 this does not raise any errors.
feat(test): add test for nested column in where query
aryem commentedon Sep 4, 2021
@MarkMurphy Can you specify sequelize version.
In v6.6.5
WhereOptionshaveLiteralthat should support nested column literal.sequelize/types/lib/model.d.ts
Line 112 in 56bb1d6
aryem commentedon Sep 4, 2021
I have added additional tests to ensure nested column in where option in #13478
feat(test): add test for nested column in where query (#13478)
github-actions commentedon Oct 9, 2021
🎉 This issue has been resolved in version 6.7.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
MarkMurphy commentedon Oct 18, 2021
This is still an issue. It works if
TAttributesisany(type WhereOptions<TAttributes = any>) because attributes there are defined asanybut it won't work otherwise.ephys commentedon Jan 21, 2022
I have a PR in progress for this #13983
The test added by the previous PR was flawed as the Model did not declare any attributes - it accepted any input by default.
feat(test): add test for nested column in where query (sequelize#13478)