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
Is your feature request related to a problem? Please describe.
In my organization, we have a database where we can't use SQL views or procedures (security reasons). We're trying to work around this by coming up with a way to compose together strings of SQL in our Java code. This would allow us to define, say, a SELECT statement in one place, test it, and then use it as a CTE in other places.
Describe the solution you'd like
If Manifold could allow something along these lines, it would address our issue:
final String inneryQuery = "SELECT PERSON_COL FROM MYSCHEMA.PERSON";
"[MyQuery.sql/] SELECT * FROM ( :inneryQuery )".fetchOne();
The text was updated successfully, but these errors were encountered:
importorg.example.queries.Persons;
. . .
"[MyQuery.sql/] SELECT * FROM (::Persons)".fetchOne();
Where the ::Persons syntax is imaginary. But the idea is to allow type-safely inlining other manifold queries. Of course, the Persons query wouldn't have to be in a file, it could be a local inline query as well.
This syntax would work anywhere a select could be used, including the WITH clause.
"""[CteExample.sql] WITH my_cte (alpha, beta, gamma) AS (::MyQuery), SELECT * FROM my_cte . . . """.fetch(. . .)
Warning, I haven't thought this through, but I think it's doable. . . at least using the ::QueryType syntax with inlined queries.
Is your feature request related to a problem? Please describe.
In my organization, we have a database where we can't use SQL views or procedures (security reasons). We're trying to work around this by coming up with a way to compose together strings of SQL in our Java code. This would allow us to define, say, a SELECT statement in one place, test it, and then use it as a CTE in other places.
Describe the solution you'd like
If Manifold could allow something along these lines, it would address our issue:
The text was updated successfully, but these errors were encountered: