Postgres Support
I'm looking forward to this project to support Postgres dialect, so it can unblock Postgres support in the prettier plugin.
Edit: I'm hijacking this issue to track the overall progress of PostgreSQL support:
- [ ] #42
- Mostly done, some quirky edge-cases remaining, like allowing some reserved keywords as implicit aliases.
- [ ] #49
- Mostly done, some quirky edge-cases remaining, like full support for custom operators and the elaborate type casting syntax.
- [ ] #96
- Nothing yet.
- [ ] #97
- Nothing yet.
- [x] #46
- [x] #44
- [x] #47
- [x] #48
- [x] #57
- [x] #58
- [x] #63
- [x] #64
- [x] #65
- [x] #66
- [ ] #67
-
CREATE/ALTER/DROP TRIGGERfully supported,EVENT TRIGGERsupport missing.
-
- [x] #73
- [ ] #78
- Full support for domains, common cases for
CREATE TYPEcovered.
- Full support for domains, common cases for
- [ ] #94
- Missing
ALTER EXTENSIONsupport.
- Missing
- [x] #99
- [ ] #98
- Nothing yet.
- [x] #103
- [ ] #105
- Almost all (except comments on operators and aggregate functions)
- [x] #113
- [x] #114
- [ ] #117
- Missing
ALTER SUBSCRIPTIONsupport.
- Missing
- [ ] #118
-
CREATE/ALTER/DROP FOREIGN TABLEsupported. Nothing else.
-
- [ ] #43
- I have barely started even mapping out the work that remains.
For reference: gram.y in Postgres Github repository.
Would also love to see PostgreSQL support here 🙌 @nene is this something on the mid-term roadmap?
Well, it is sort of on the roadmap since starting working on this whole library. But Postgres being pretty big and complex, just the thought of the task ahead puts me off from starting to implement support for it.
Understood, thanks for the reply. Really appreciate the work that you're doing on both this project and sql-formatter.
I guess there's also not a way to build on existing parsers / existing schema data or use code generation somehow to reduce the implementation complexity here... 🤔
To fully support postgres, it would be good to support psql meta commands (starting with \) and variables (with :), too.
To fully support postgres, it would be good to support psql meta commands (starting with ) and variables (with :), too.
Yep. This is in the plans. But for now I'm concentrating on finishing the support for the actual SQL part.
Another thing to fully support Postgres is having support for PL/pgSQL.
I think both can be implemented as supersets of the base PostgreSQL grammar.