Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thats nice to know!

If you are a PRQL dev i have a suggestion for you/your team.

Make PRQL language agnostic. In a real life scenario many people are writing SQL not in the app layer, but more ad-hoc for stats, reporting, analysis, examining the data etc.

What i mean by this is:

If i write an app that has embedded SQL i dont really care to much for the possible verbosity. This code will be used more than once, so im OK with taking the extra effort. Also all languages has an query-builder / ORM so the benefit of something like PRQL is possibly not big enough to merit it as an additional dependency.

My suggestion:

Make PRQL a cli tool that can be used by allowing users to connect to a database in a similar fashion as something like usql (https://github.com/xo/usql), I would find the most power in a tool like PRQL is this setting: Ad hoc SQL queries.

This would open the editor integration. With a tool like this i could open vim, and write PQRL in a window, and pipe it via something like Slime to a open PQRL session.

This would be pure money!



So something like a language server, but connected to a database and able to execute queries? That's an interesting idea.

While working on the compiler, I try to separate different components so things like this are possible. Currently, we are focusing on the language itself and also put some though into intermediate representation of the query (RQ - relational query). We are conservative about expanding the scope, because building database connectors and execution engines would take too much focus off the language and the compiler.

But I'd lie if I said that I don't want to dig into it.


Well an LSP server would be a welcome addition.

But before that i would put some effort into the actual "repl/session" -like tool. Pipe a PRQL query to a PRQL session, and then the PRQL translates that to SQL, and returns the underlying response from the database.

If done right, this would open the possibility to build all sorts of cool editor plugins, that could directly interface with the PRQL session.

IMHO this is where a tool like PRQL would shine, as it would make writing SQL more enjoyable and way faster, but at the same time being both language and sql-dialect agnostic.


Seems a natural fit for a notebook UI. If a PRQL cell doesn't start with "from," just continue adding filters to the pipeline above. Would let you progressively build pipelines by adding filters and derivations, while previewing the data each step along the way. Split a cell to debug a pipeline at any point.


Thanks for the suggestion. I don't think I knew about usql. I completely agree with you and have been working on a cli tool called `prql-query` or `pq` at the command line:

https://github.com/prql/prql-query/

Unfortunately I haven't had much time to spend on it of late but hope to push some updates soon.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: