-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow multiple queries per file? #1825
Comments
I agree, this would be useful and proposed idea seems sound. |
Related to #1803 |
I'm trying to think of a good API for the
I'd be up for doing this fairly soon if we can get to consensus on this. |
I don't think returning just CTEs is a good idea - it not valid SQL and is not easily composable - it there a WITH in the front? Can there be a WITH RECURSIVE? Is there a following comma? I'd rather suggest that:
For importing other files, I'd suggest we have a different interface, which would have a |
Very much agree @aljazerzen; great design
So we'd have two fields — a string message and a (string?) code / type? In python we could produce custom errors — different types (though not an If we're not sure, we could also make this change at the VSCode extension level for the moment and just manually parse the error.
My nit is that this follows me around suggesting I have errors in the project; unrelated to the preview. |
We already have quite a few, adding a string code would not be a big deal. https://github.com/PRQL/prql/blob/main/prql-compiler/src/error.rs#L78-L90
Yeah this bothers me too. |
Ah, I see, we actually serialize this whole struct into a JSON string and send it to JS: Line 119 in ed8a1c0
How about we start by including an |
Actually, while the error types sounds like a good proposal, I don't think it's the closest way of solving the "missing main pipeline". I'm going to comment on #1803, and we can dedicate this issue to just allowing multiple queries per file |
My bad, I mixed up the issues here. Yes, let's keep this issue for modules, exporting definitions out of files, I have a few unfinished thoughts about this. |
Closed by #2129 (not yet complete, but that contains the path forward) |
Currently we have a nice, simple structure — we can define a pipeline consisting of transformations, and optionally including some parent pipelines with
let
.One quite nice thing about Malloy is the ability to export multiple pipelines in a file (example). They can then be shared across files.
One starting idea for how the this could work in PRQL
let
, it becomes a "module" file; and we compile all the relation variables (aka CTEs) and return a map of themcompile
, likeimport
It's important the project remains focused — it's very easy to try to do everything and do nothing well — we still have lots to do on the basic pipeline. So possibly this is something that should come later.
The text was updated successfully, but these errors were encountered: