-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add support for Postgres Aggregate expressions #75
Comments
Thanks for reporting. This is indeed a problem in the parser. Looks like I have skipped over this part of PostgreSQL documentation. Thanks for the link. Apparently I have explicitly enabled the FILTER syntax only for SQLite. Should be a simple fix to right it. |
Fixed the FILTER-issue. But there's more in this aggregate function syntax that I'm missing. Will probably do a release with just that fix though. |
Could you please cut the release as well? |
@roman-vanesyan the release with this fix is now out and I've also released new version of the prettier plugin. |
Hey! First of all, I'd like to thank you for your work. You're truly doing an awesome job!
Recently I've been dealing with Postgres aggregate expressions and https://github.com/nene/prettier-plugin-sql-cst is failing on formatting them. AFAIA, the prettier plugin is based on this parser. I tried to look across this repository's issues but seems like there is no tracking ticket for this functionality.
Here you can read about aggregate expressions https://www.postgresql.org/docs/16/sql-expressions.html#SYNTAX-AGGREGATES.
Here is an example of a query for which formatter is failing:
The stack trace:
Here are the dependencies versions:
Prettier config:
The text was updated successfully, but these errors were encountered: