You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One naive approach would be to keep the Enum we currently have, and then have a lookup to find the respective struct. Then the appropriate functions in translator.rs could part of a Trait which structs would implement. That seems worse than implementing them on the object which is a field of Query though.
Are there approaches that won't lead to nD x nV implementations, where nD is the number of dialects and nV is the number of versions? Are there other libraries that do this well?
The rust language manages editions — I haven't looked into the mechanics, but the basics are here. And sqlparser-rs has a nice simple way of handling dialects
Activity
max-sixty commentedon Apr 17, 2022
I had a quick go at including a
structin the definition of aQuery, but got some rust type errors around object safety which I didn't take the time to figure out. Here's where I paused (but is maybe not even helpful to start from) https://github.com/prql/prql/compare/dialectOne naive approach would be to keep the Enum we currently have, and then have a lookup to find the respective struct. Then the appropriate functions in
translator.rscould part of a Trait which structs would implement. That seems worse than implementing them on the object which is a field ofQuerythough.max-sixty commentedon Apr 18, 2022
This also applies to versions.
Are there approaches that won't lead to nD x nV implementations, where nD is the number of dialects and nV is the number of versions? Are there other libraries that do this well?
The rust language manages editions — I haven't looked into the mechanics, but the basics are here. And
sqlparser-rshas a nice simple way of handling dialectsaljazerzen commentedon Apr 18, 2022
Having
dyn Dialectin AST will be quite painful because of serialization and de-serialization.What about having:
so
Dialectenum can be in AST, andDialectHandlertrait is used for nice polymorphic behavior?I'm pushing such commit now, feel free to revert it.
max-sixty commentedon Apr 25, 2022
Closed by #398, thanks to @aljazerzen ; I'll open a new issue for versions