oguimbal / pgsql-ast-parser

Yet another simple Postgres SQL parser
304 stars 43 forks source link

No parentheses indicator? #131

Open rgwozdz opened 1 year ago

rgwozdz commented 1 year ago

If I parse:

SELECT * FROM cars
WHERE
(model = 'ford' OR model = 'benz' OR model ='honda') AND color = 'white';

And I examine the AST of the WHERE, there doesn't seem to be any explicit indication of the parentheses being present on the left node of the tree. Can you confirm? The node-sql-parser adds a boolean flag to each node if it is enclosed by parentheses. Are you open to adopting this pattern in this parser? If so I can attempt a PR?