Better logic for Array Expressions vs. Squared Bracket Quotation #1180
Replies: 3 comments 1 reply
-
Sorry for my late answer. I was some days out of being connected :(. I don't know why you want to detect this automatically, since it is mutually exclusive for the used databases. Additionally, using a regexp does not work here. Quotation means, you could write anything into your title, so:
means for one database return array value of index 3 and for the other return value of a with the column alias "1 + 2". Expressions like ARRAY[20000, 25000, 25000, 25000] (array is a keyword), will be processed as arrays either way. |
Beta Was this translation helpful? Give feedback.
-
Welcome back! You are right of course, your corner cases will confuse the detection. So definitely, there must always be a hard overwrite possible (e.g. enforce SQUARED BRACKETS when not set or disable it when detected wrongly). So I see it as a good guess and have implemented it like that in JSQLFormatter already. We can close this discussion. |
Beta Was this translation helpful? Give feedback.
-
There are still a lot of "invalid" error reports linked to this topic. And honestly, I do understand where these guys are coming from: any T-SQL person would expect to be first citizen and would wonder, why his SQL with squared bracket quotes is not parsed. Keep in mind, that also the Parser Error messages are not helping to understand what is going on. So I wonder if we:
I would like to expect a better user experience and also less frequent error reports on this issue. |
Beta Was this translation helpful? Give feedback.
-
Maybe we can apply an automatic detection based on Regex
It will find() for:
It will NOT find() for:
Beta Was this translation helpful? Give feedback.
All reactions