-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(utils): infer primaryKeys from a DML model #7839
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
|
packages/core/utils/src/dml/helpers/entity-builder/infer-primary-key-properties.ts
Outdated
Show resolved
Hide resolved
continue | ||
} | ||
|
||
if (parsed.dataType.name === "id") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: for consistency and make it easier can you use the same approach as the other ones and if there is no type you can add a symbol.for to which we can refer too without being shown in the auto completion and then we can use it every time we need without having to think about which value to compare to know that it is an id.
You can look at the dml, properties and relations they all provide a static method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave this a shot, but doesn't look nice when i tried it. Lets pair on this in the next PR. 👍🏻
what: