MySql or Postgres example?

I would need to know if it’s possible to compile a SQL query with the SqlParser and make it usable for any data source.
For example, establish a db connection by using a compiled query or just convert a general one onto a source-specific one?

Thanks in advance

This is indeed possible, but you would be limited to the intersection of features supported by PartiQL and the target language.

MySQL and Postgres do not support executing PartiQL queries directly, which means we need a transformation layer. That might consist of something that traverses the PartiQL AST and generates SQL that is compatible with the target language along the way.

Although I caution that this API isn’t necessarily stable at this point but you could take a look at AstWalker and AstVisitor to see how this might be done. You’d need to implement your own AstVisitor.