David-Wobrock / sqlvalidator

SQL queries formatting, syntactic and semantic validation
https://pypi.org/project/sqlvalidator/
MIT License
67 stars 16 forks source link

Comments are not handled correctly #37

Open aymen-k opened 2 years ago

aymen-k commented 2 years ago

Hello David 👋

I just noticed that comments are not handled correctly when formatting the SQL queries. For example

SELECT * FROM table_a
WHERE user_name="john doe"
/* just a comment */
ORDER BY user_id

is transformed into

SELECT *
FROM table_a
WHERE user_name="john doe" / *

PS: Thanks for the tool!