Open GrandChaman opened 3 years ago
Before reviewing the PR, have you tried extending the CTE interface for your needs?
https://prisma.github.io/quaint/quaint/ast/trait.IntoCommonTableExpression.html#method.into_cte
I'm just seeing this would fit for your needs, but it for now supports only SELECT queries. Should not be that bad to extend though?
Yes, but sometimes one wants to use database specific function (that are not yet part of this library). Doing so with string concatenation makes it easier for onboarding rather than having to wait for every database specific feature to be available.
But you're right that in the attached example, the use case could be covered using the into_cte
.
I'd like to see a PR first implementing the CTE fixes, I need to think a bit more on the other PR before accepting the solution. And I'm pretty fried after a long day already :)
Hi !
Some database specific features are missing from this library. Rather than implementing everyone of them. It would be nice to be able to reuse an argument vectors, so that when concatenating queries, the arguments will be correctly numbered.
Something like (pseudo-code) :