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
AstVisitor to see how this might be done. You’d need to implement your own