Skip to content
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

SQL Editor with 30+ Databases - close to PRQL support #4502

Closed
ryanhamilton opened this issue May 24, 2024 · 14 comments
Closed

SQL Editor with 30+ Databases - close to PRQL support #4502

ryanhamilton opened this issue May 24, 2024 · 14 comments

Comments

@ryanhamilton
Copy link

What's up?

"We’d like to make it easier to try PRQL. We currently have the playground, which compiles PRQL and runs queries with a DuckDB wasm module, but there’s much more we could do. "

Hi,

I have just added PRQL syntax highlighting to qStudio (screenshot below).
QStudio is a free and open core SQL Editor for data analysts (https://www.timestored.com/qstudio/).
Today it only highlights code but it would be very easy to add the ability to run PRQL against all 30+ supported databases.

The main blocker is that I don't want to add ~20MB plus to the download size of qStudio (99MB) for functionality not many people may use. My proposal:

  1. PRQL to commonly provide a binary/.exe for each platform and recommend people install it to their path.
  2. Tools like qStudio can then run prql.exe "prql-code" to convert it to SQL
  3. qStudio would then run that SQL.

Or I am open to alternative suggestions.

image

@vanillajonathan
Copy link
Collaborator

I cannot find your commit to qStudio for PRQL syntax highlighting.

We have the prqlc (PRQL compiler) tool that you can install using winget:

winget install prqlc

@max-sixty
Copy link
Member

Hi @ryanhamilton ! qStudio looks great, nice work...

That would be super from our end. We do already produce binaries, for example: https://github.com/PRQL/prql/releases/tag/0.11.4

FWIW my guess is that asking folks to add the binary to their path might be difficult for the average user. I get the reluctance to make your binary heavier, though the compressed binaries are 3-5MB at that link...

There was some work to make a Java binding — we still run tests on it, so it very likely works — though I haven't heard of that many folks using it...

@richb-hanover
Copy link
Contributor

@ryanhamilton This is SO COOL! I downloaded a copy and I like it a lot. (This seems pretty mature - you even support different themes, which makes me happy. (I'm a Solarized Light kind of guy :-)) Adding direct support for PRQL would make my day.

I found a few rough edges while I was downloading/installing. What's the best place for me to offer comments/suggestions? Thanks!

@ryanhamilton
Copy link
Author

Thanks @max-sixty @vanillajonathan - That worked!
This is now done and well I think it's pretty cool :)
I tried querying sqlite, duckdb and H2, all of them just worked. If you download the latest 3.02+ it's in there:
https://www.timestored.com/qstudio/prql-ide

What's the best place for me to offer comments/suggestions?

@richb-hanover The best place is on github: https://github.com/timeseries/qstudio/issues
If possible please star the project as after 13 years I'm trying to fully open source the project: timestored/qstudio#43

The one thing I wasn't sure of is what separator PRQL uses between separate statements. I assumed ;.

If it gets enough users I can see about adding automatic download of prqlc. 🚀 👍

prql-sql-ide

@richb-hanover
Copy link
Contributor

Oh wow! I so want to look at this (but it'll probably have to wait 'til this weekend...)

PS PRQL is line-based - there are no "end of line" separators. Thanks!

@ryanhamilton
Copy link
Author

Thanks for your help @richb-hanover , between us we got it working. 👍
I hope you find it useful and this proves an easy way to get PRQL to more users. Now any database should be usable with PRQL.

I have added a custom demo page:
https://www.timestored.com/qstudio/prql-ide
and I will shortly email our existing userbase to announce the support.

@richb-hanover
Copy link
Contributor

@ryanhamilton I would hold off on a big announcement. I tried it with a big query that works fine when I paste the SQL into SQLiteBrowser, but throws an error in qStudio. (That's what I had in mind in my note at timestored/qstudio#44.) I'll aim to get a complete report to you by this weekend. Thanks again.

@ryanhamilton
Copy link
Author

It would be good to get some more PRQL users really using qStudio to iron out any bugs or to raise feature suggestions.
Could qStudio be added to the list of integrations?
I'm happy to raise the PR but wasn't sure if you would welcome it or not.
Let me know.

image

@ryanhamilton
Copy link
Author

FYI The new qStudio with PRQL reached the top of HN
https://news.ycombinator.com/item?id=40562210
https://www.timestored.com/qstudio/release-version-3
So there's at least 1000+ people with a version that has the integration already :)

@richb-hanover
Copy link
Contributor

Congratulations on HN coverage! I especially like this:

Year 1 - Getting the first version out that worked for me and my colleagues. Year 2 - Cleaning it up enough to promote wider use. Documentation. Years 3-5 - Minor bug fixes only as I thought qStudio solved the problem. Years 6 - I realised restricting qStudio to only 1-2 database technologies was foolish. Major change to support many more databases. Improved generic SQL highlighting. Added a partial dark mode. Years 7-8 - Minor bug fixes. Year 9 - Added a proper Dark Mode and support for many themes by using FlatLaf. Now looking properly modern. Year 10 - Realise that I'm not fully solving the problem. That actually for most data analysts I should support creating the analysis (pivot table) and improve exporting (real excel export, not just nicely escaped CSV).

That comports with my mentor's adage:

  • To make software for yourself, it takes X units of work
  • To make software for your colleagues, it takes 3X
  • To make generally useful software, it takes 9X

It sounds reasonable to have qStudio listed as an integration. I'll talk it up. Thanks again

@richb-hanover
Copy link
Contributor

richb-hanover commented Jun 6, 2024

@max-sixty I've been having a lot of fun with qStudio. Any reason we shouldn't list it as an integration? (It is, after all...) Thanks

Update: I raised a PR #4547

@vanillajonathan
Copy link
Collaborator

@ryanhamilton I cannot find your commit to qStudio for PRQL syntax highlighting.

@max-sixty
Copy link
Member

Congrats on the HN exposure @ryanhamilton !

@ryanhamilton
Copy link
Author

Closing as resolved and thanks to @richb-hanover I'm managing to close out some bugs.
Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants