sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
12.51k stars 784 forks source link

Moving the SQL Parser to a publicly available pkg #1793

Closed collinforsyth closed 2 years ago

collinforsyth commented 2 years ago

What do you want to change?

Would you ever consider moving the parsing/tokenizing of the SQL AST to a package that other Go libraries could use? This is a much better API than the pg_query_go provides

I'd be happy to help out with the work if you would consider it.

What database engines need to be changed?

No response

What programming language backends need to be changed?

No response

kyleconroy commented 2 years ago

My usual answer here is no. The internal packages are kept private so that they can be refactored without impact others.

That said, can you elaborate a bit on the specific parts you'd like packaged up? sqlc doesn't do any of its own parsing. The AST package was based on a older version of the pg_query_go AST package.