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] Crashes when default value contains line breaks #1382
Comments
Needs decision @sorenbs:
|
DECISION: Initially we will not support newlines in default values. If introspection encounters a default value with newlines, it should not print it. We do not need to explicitly handle this in the parser - it is acceptable that we give random parse errors. |
Slight adaptation: Let's treat this as a light guardrail, and print a comment in the schema - but not send a warning to the CLI as it doesn't make a difference right now. |
Just don't spend any time trying to print a multi-line, commented-out default value. No mess like this:
|
lol no - just a comment that the default value is missing here because %explanation+link% Suggestion:
|
Default value is removed - but is currently not treated as guardrail yet (which is not super important, but would be nice to have). |
I've observed the Prisma 2 introspection code crash when a default value is not a constant, but some expression, in my case also containing a new line.
Consider a column in postgres with the following default value:
Introspection crashes with:
The text was updated successfully, but these errors were encountered: