3 ms·
I was recently searching for something like this - the ability to write PRQL queries on mobile is my ideal usecase. As you note, PRQL is perfect for putting tog
by DannyPage 3y ago
I was recently searching for something like this - the ability to write PRQL queries on mobile is my ideal usecase. As you note, PRQL is perfect for putting together queries with drop-downs, so I'm a huge fan of the UI that you've put together. Feature request: Exposing the PRQL would be great, and using tabs to switch between the query and results would make it possible to work on mobile. Lastly, bookmarking those queries for later use would be great too!
- prasoonds 3y agoYes! I'm heartened to see people realize the the benefits of PRQL and chained transforms over vanilla SQL (with some caveats!). We'll definitely add a PRQL/SQL block to the UI soon (you will be able to toggle to select which one you'd like). On that point - PRQL doesn't natively support PIVOT statements. As a hack, we made our own flavor of PRQL with a PIVOT statement and we parse that to SQL CTEs to make it work for now. I will be submitting a pull request to PRQL to add support to get around this. We're working on saving queries to local storage as well as sharing via downloadable config files (we're thinking a PRQL file with some sugar that when uploaded, recreates the entire transform)
- maxloh 3y agoIt would be good to have EdgeQL too.
- prasoonds 3y agoOh this looks really interesting! I hadn't heard of EdgeDB/EdgeQL - I'll have to do a deeper read but at first brush, it looks like EdgeQL can be compiled down to SQL based on this HN comment: https://news.ycombinator.com/item?id=30296669 https://news.ycombinator.com/item?id=30296669 I'll take a look and if it's simply a matter of changing from the PRQL compiler to EdgeQL compiler, then, we should be able to have land in main in short order. It's not the highest priority thing right now though.
- deleted 3y ago[deleted]
- d1sxeyes 3y agoFor folks looking for a workaround in the meantime, you can add an AI block and it will give you the returned SQL to edit. Not ideal because it’s just wasting credits, but it worked for me.
- maximilianroos 3y ago[PRQL dev here] Love what you've done and thanks for building on PRQL! We're very happy to add something like a PIVOT statement. In the long term, we'd have to think about how to make it work deeply in PRQL, since the column names are suddenly runtime dependent. In the short term, we should definitely make PRQL work for your case — it's important that there's an escape hatch for things that aren't natively supported by PRQL yet. (We have s-strings but I'm guessing they don't cover this specific case?)
- prasoonds 3y agoHey Max, love what you all doing with PRQL! It's a wonderful tool. That makes sense. I ran into some old issues about Pivot but it seems it's not been implemented yet. And yes, s-strings wouldn't work - the DuckDB pivot statement looks like this: PIVOT ⟨dataset⟩ ON ⟨columns⟩ USING ⟨values⟩ GROUP BY ⟨rows⟩ So, we'd have to pass the `dataset` so far into the pivot statement. This is where CTEs come in handy but happy to hear if there's a better solution :)