andialbrecht / sqlparse

A non-validating SQL parser module for Python
BSD 3-Clause "New" or "Revised" License
3.76k stars 700 forks source link

Thoughts on translator / Custom formatter support #702

Closed randxie closed 1 year ago

randxie commented 1 year ago

Great work on creating the sqlparse package!! I am wondering if you have thought about allowing translating from one SQL dialect to another, or allow custom formatter to output SQL in a different way?

Providing more contexts on my use case, in my company, we used pyparsing to implement a small SQL parser, and we have custom formatter to translate that SQL into Flink and Spark SQL. But we are tired of maintaining our own SQL parser and have started to research other solutions.

Do you foresee generating customized-format output aligns with sqlparse's roadmap?

tobymao commented 1 year ago

sqlglot is a python parser / transpiler that was built for this use case

randxie commented 1 year ago

Thanks @tobymao !! Will take a look at sqlglot