If you're looking for a good sql library to use I did a review/survey of parsers in a bunch of major languages. Most of them are full postgres or mysql parsers.
https://datastation.multiprocess.io/blog/2022-04-11-sql-pars...
https://datastation.multiprocess.io/blog/2022-04-11-sql-pars...