-
Notifications
You must be signed in to change notification settings - Fork 43
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
Uncaught error when retrieving columns info with jsonb[] with default values #72
Comments
As discussed in this thread, we could wrap the parsing with a try/catch to avoid stopping the execution unexpectedly. I don't mind doing this change, but I need to understand if:
|
Heya! Me again 👋🏻 What is the "raw" javascript representation of a default value as returned by |
Hey there, So, their documentation is a bit incomplete: But their code shows that the text value of |
Hmm odd, that makes me wonder why the parse default value step fails then. Technically speaking, passing an array of JS objects to JSON.parse() shouldn't crash like that 🤔 |
But in this case, the default value that we are trying to parse is |
@ntma Oh I see, when you mentioned:
I thought you meant that it would be returned as actual valid JSON (as ARRAY[] isn't actually JSON ofc) |
I am sorry for the confusion @rijkvanzanten . TLDR we have in one side the parsing that the On the other side we have the parsing that |
@rijkvanzanten Isn't this (kinda) fixed with #117 since we now return unparsed JSON strings? |
Yes! |
Hi knex-schema-inspector team,
Due to the nature of this regex, it seems that the default value of columns defined as
json[]
orjsonb[]
will be parsed as Json objects and throw an uncaught error.Reproduction
In this case, the parsing will look like
JSON.parse("ARRAY[]")
, which is not a valid format.The text was updated successfully, but these errors were encountered: