-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Introspection] Panic "No id field defined!" (caused by: no id at all) #1113
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
DecisionWe have no Guardrails for this, so we will hope for the feature to be implemented in time. |
Collection of schemas where the complete absence of an @id or @@id was confirmed as the source of the panic (via adding a https://github.com/prisma/introspection-engine-output/blob/master/mysql_127/Accidents.log This is the only (!) schema where the absence of @id or @@id caused a panic - all others are already failing during validation, which is tracked in: #1083 |
Which leads to the real question: |
Seems the validation does not trigger because the schema could essentially be rewritten as:
As soon as Is this a validation bug? |
Investigating and fixing other schemas lead to discovery of more such cases:
https://github.com/prisma/introspection-engine-output/blob/master/postgres/sportsdb.log These also pass validation with their relations, and then cause a panic later. |
Question: Does it make sense that it does not fail in the validation step already? If not, we should add that (and by doing so give us an opportunity to educate the user about workaround (fix table, remove table from introspection) and thus avoid this panic. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Internal Note: See #1515 |
These cases will now give a validation error asking for an Id to be added. See explanation here: #1515 |
Error: Schema parsing thread 'main' panicked at 'No id field defined!', src\libcore\option.rs:1190:5
panic-no-id-field-defined
probably caused by
source: https://github.com/prisma/introspection-engine-output/blob/master/more_mysql/Accidents.log
possible explanation:
The text was updated successfully, but these errors were encountered: