prql
prql copied to clipboard
Use s-strings to generate a CTE
Currently:
table x = (
s"SELECT * FROM employees"
)
from x
returns
Expected a known transformation; got s
I'm not sure the exact form that the s-string should be in, but this would allow any form of escape hatch. Currently if someone wanted to do something beyond a statement — e.g. a lateral join, which we don't support — then that wouldn't be possibl.
I would expect such statement to have form of:
table x = s"SELECT * FROM employees"
because a SELECT has the same "type" as a pipeline not a transform inside a pipeline.
Yes agree, good point. (It does give the same error though)
I notice you took off the milestone — how difficult do you think this is @aljazerzen ? I do think that we're likely to have lots of missing things, and so without this, people will hit a cap without an escape hatch.
I may try and implement r# strings, which would be necessary for this.
It would require a few tweaks to the parser, which might cause a cascade.
I didn't know how important is it, I you feel that people will quickly hit this limit, we can do it in 0.2 milestone.
Closed by #1197