-
Notifications
You must be signed in to change notification settings - Fork 412
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
Parsing of Postgres array slice operator throw error #624
Comments
Thanks for reporting. That's definitely a bug in the parser. |
I'm wondering how this issue can be solved. It seems that single parser handles all dialect. |
You're correct @wirekang. The formatter has a very rudimentary parser which is used for all dialects. There are some options passed to the lexer to define which dialect supports which keywords and operators. So a simple way to fix this error is to add Unfortunately there's also a bug with parenthesis formatting, so we'd end up with the following: select
(array_agg("test")) [:5] as "test"
from
"user" But definitely better than crashing :) |
Fixed now in 13.0.1 |
Input data
Actual Output
Usage
How are you calling / using the library?
SQL compile (parse) error when slicing an array. wirekang/kysely-playground#11
What SQL language(s) does this apply to?
Postgres
Which SQL Formatter version are you using?
12.2.0, 12.2.3
The text was updated successfully, but these errors were encountered: