fix(orm): disallow include on models with no relation fields#2489
fix(orm): disallow include on models with no relation fields#2489
include on models with no relation fields#2489Conversation
…deOmit) Co-authored-by: jiashengguo <16688722+jiashengguo@users.noreply.github.com>
include on models with no relation fields
|
@copilot there is build error, fix it |
Co-authored-by: jiashengguo <16688722+jiashengguo@users.noreply.github.com>
Fixed in b9d581e. The build errors were in three places where the
|
| } | ||
|
|
||
| if (typeof payload === 'object' && payload.include && typeof payload.include === 'object') { | ||
| if (typeof payload === 'object' && (payload as any).include && typeof (payload as any).include === 'object') { |
There was a problem hiding this comment.
do not cast it to any, add a 'include' in payload check should be good to go.
the same for other changes in this file.
There was a problem hiding this comment.
Done in 46ea0e2. Replaced all (payload as any).include casts with 'include' in payload checks in both lateral-join-dialect-base.ts and sqlite.ts.
…owing checks Co-authored-by: jiashengguo <16688722+jiashengguo@users.noreply.github.com>
include on models with no relation fieldsinclude on models with no relation fields
include on models with no relation fieldsinclude on models with no relation fields
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
…ns simplification Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
|
@copilot build is failing again |
…ck depth in CI build Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
Fixed in 5292a9f. The |
HasRelationstype helper incrud-types.tsincludeinSelectIncludeOmitbehindHasRelationstypecheck.tsincludeon genericFindArgsunion type(payload as any).includewith'include' in payloadchecks inlateral-join-dialect-base.tsandsqlite.tsHasRelationstoRelationFields<Schema, Model> extends never ? false : trueBeforeEntityMutationCallbackcast inzenstack-query-executor.ts(TS2321 reappears in full CI build)Original prompt
includeis allowed by type checking even when the model has no relation field. #2488💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.