-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PRQL #1075
Comments
To load it client-side: <script src="npm:prql-js/dist/web/prql_js.js"></script>
<script>self.wasm_bindgen = wasm_bindgen;</script>
```js
const {compile} = wasm_bindgen;
await wasm_bindgen(import.meta.resolve("npm:prql-js/dist/web/prql_js_bg.wasm"));
const sql = compile("from employees | select first_name");
display(sql);
``` |
Hi from the PRQL team — let us know if we can be helpful here! I saw on a linked issue that a release would be helpful, so we can do one of those shortly... |
Thanks @max-sixty! An ESM release is very welcome. As far as the integration we’re prototyping in #1078, the main outstanding task for us is transpiling PRQL to SQL while preserving placeholders. We have as input PRQL with interpolated expressions such as this:
Our goal is to rewrite this as SQL with interpolated expressions in the correct place, like this: SELECT *
FROM gaia
WHERE phot_g_mean_mag < ${mag}
ORDER BY phot_g_mean_mag
LIMIT 10 My current plan is to pass the following to
Then take the output SQL: SELECT *
FROM gaia
WHERE phot_g_mean_mag < $1
ORDER BY phot_g_mean_mag
LIMIT 10 And re-insert the original placeholders ( SELECT *
FROM gaia
WHERE phot_g_mean_mag < ${mag}
ORDER BY phot_g_mean_mag
LIMIT 10 The approach assumes that PRQL’s |
Great @mbostock ! While PRQL doesn't support |
Nice to know, @max-sixty. I was just using |
Ah great @mbostock , thanks for explaining. That works well! |
It compiles to SQL, so it should be a pretty easy lift, maybe?
https://prql-lang.org/
The text was updated successfully, but these errors were encountered: