Interestedin postgresql transformer
aminechouicha opened this issue · 2 comments
aminechouicha commented
Hi.
I am interested to contribute for postgresql. Any pointer how to go about. Thank you.
duartealexf commented
Hi @aminechouicha thank you for taking interest! 💯 🥇
Some first steps:
- Get familiarized to the PostgreSQL syntax particularities
- Get familiarized to (almost) everything supported by PostgreSQL DDL
- Get familiarized to Nearley syntax
- Refer to the Contributing section in the readme to understand where to put things together in the repository.
Most of the work is comprised of:
- Converting PostgreSQL syntax boards into Nearley language. For example, see this synopsis section of the
ALTER TABLE
statement – you'll be writing a Nearley version of it... probably breaking it down into:- alter table definition
- alter table: action (for the part where it says "where action is one of" in the synopsis)
- partition_bound_spec
- column_constraint
- table_constraint
- table_constraint_using_index
- ...etc
This project supports parsing most DDL statements for a given language, so if it parses CREATE TABLE
then later ALTER TABLE
, the output respects the table alterations made to the created table... so some post-parsing specific logic is required – for example, see what adding a primary key does to the table in MySQL: here and here.
duartealexf commented
Let me know if there's anything else. Closing this for now.