-
Notifications
You must be signed in to change notification settings - Fork 215
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
Publishing prql-java to maven central #1643
Comments
The java lib is incomplete now. If you want to use it immediately, you can build it local. |
Thanks @doki23. Understood prql-java and dialect support are still at early stage. What I'm trying to do is a fast prototype hoping to increase usage and get more feedback for future development. I'll try to create a new artifact later next month, if there's no plan to release the official Java lib. |
I would also like to use PRQL from DBeaver and commented a bit on that in a thread on Discord: https://discord.com/channels/936728116712316989/1066475896581660773/1067781287009591398 A JDBC driver to enable this would be huge! @zhicwu If you want to take a stab at it, I'm sure the team will offer you as much support as we can! |
Thanks @snth, good to know it might be of use :) A DBeaver plugin would be great, but it's just one database client, right? Perhaps it's better to create Anyway, the rough idea I have in mind at this point is:
Jokes aside, I think it's critical to publish |
All of those steps sound great! :) In particular a PR to bring FWIW we have lots of syntax highlighting libraries already, so hopefully integrating into something like DBeaver will be fairly simple. V happy to help with that sort of thing if it can get tools to adopt PRQL. |
@zhicwu your proposal for a Looking forward to seeing what you come up with! |
Great! So I forked the repo, did some search, and thought this over. I'm going to create 2 or 3 PRs one by one for each of the changes shown below. Please review and let me know if there's any concern or better idea.
It's not complex but I do need some time to complete all the work, and I didn't mention documentation at all ;) Besides, I know nothing about rust, so I'll simply reuse what we have here to build the JNI lib and get them packed in prql-api.jar. Lastly, please help with below items in order to publish the artifacts to maven central:
Will start with prql-java rewrite if we're all good with above. We can discuss details on Discord if needed. |
This sound awesome @zhicwu ! I have very little Java experience, so I these comments won't be that insightful unfortunately. But others should feel free to comment as ever. A couple of small questions:
We have changed our API slightly to use prql/prql-python/python/tests/test_all.py Line 36 in 1fdd322
Is this standard in Java? Generally I would have imagined this might give confusing error messages, and having no fallback would be OK. But again, if this is standard in java then great.
Would this mean that someone could use
I couldn't find anything online about Congo grammars. What would the goal of this be? For syntax highlighting?
We're very happy to help on the rust side!
For sure, let me know when you're ready and I'll make some keys...
Great. Not sure how it standardizes around punctuation. The website is |
Thanks for the feedback!
Sure, will do the same in Java for consistency.
It's not a standard. The idea is to try harder to make it work even when JNI library is missing or not working(incompatible with the installed lib for instance).
Yes, a JDBC driver for PRQL so that all JDBC-based database clients understand PRQL. The JDBC library is a wrapper of existing JDBC drivers. It takes PRQL as input, call above method for PRQL-to-SQL compilation, and then pass the SQL to the actual JDBC driver for execution.
Sorry I was talking about https://github.com/congo-cc/congo-parser-generator (migrating from https://github.com/javacc21/javacc21). It will be a parser generating AST, so it would be overkill for syntax highlighting etc. I take that as an approach of learning PRQL grammar, but I hope to do more with that for client-side optimization in the future, for example enhanced grammar for queries across multiple datasources etc. Probably worthy of a separate issue for discussion.
Thanks. I think you may start to make the keys, apply access and maven group id on sonatype, and setup repository secrets whenever you have time :)
Unfortunately Java does not support |
Sounds great! But maintaining an individual java parser may be painful. If that's the case, substrait is recommended(#738). |
That all sounds great. From the perspective of the project here's a quick take on each of the items — but also do what you want to do:
OK cool. I registered prqllang.org and redirected it (doesn't redirect correctly for a few hours though) |
Thanks @doki23 and @max-sixty! Let's drop the crazy idea of having prql-parser in Java for now :) To recap what we discussed:
I have some work on hand to complete by this week. Will try to get back to this next week. |
This would be so huge! Can't wait to see this come to life! |
If hyphens aren't allowed in the domain name on Maven maybe you could replace it with a underscore? Like |
As discussed with @zhicwu :
This will let us merge his excellent code, so we can base further changes on that code. Hopefully @linux-china can offer feedback as the original author, and a consumer of Thank you @zhicwu ! |
Thanks @max-sixty. Please add dns TXT record for validation as requested at here. |
Thanks @vanillajonathan, let's use underscore then. |
Done! |
Hi, what is the current status of this? |
@zhicwu let me know if you had any time to work on this — the code was already very close indeed! |
Apologies for my delayed response. I've spent most of my spare time trying to close a release by tomorrow. I should be able to get back to this later next week. |
You may now download the JDBC driver (e.g. |
Great news! I've tested it using DataGrip, and managed to connect to the database, but it was not compiling PRQL to SQL. |
Ah I was using Now it's working great. The introspection is not working (obviously), but otherwise, this is a great interface for testing out PRQL! |
@zhicwu This is very exciting! Thank you very much for this! 🙏 I'm trying to use this with DBeaver on Windows but am having some issues: I downloaded the jdbcx-driver-0.1.1.jar file and placed it in the I don't actually have a working prqlc binary that's reachable from Windows since I usually do all that from WSL but I assume that I would get a different error for that? |
Thanks for the feedback! Indeed there's issue on Windows, but it's been fixed in 0.1.2. Judging from the error message, you need either put PostreSQL JDBC driver under As to |
Hi all, I have found an easier way to set up this PRQL wrapper in DBeaver, by getting DBeaver to handle the driver download :) I will use the example of setting up PRQL with the Postgres JDBC driver.
At this point you should be able to enter host, port, database, username and password and connect as usual. Any queries you make through this connection will use PRQL! Many things will still break: for example the interactive filtering, grouping pane, etc. But you can enter and run PRQL queries from the scripting window. |
That's cool! We have to get a summary of this thread into the book: https://prql-lang.org/book/project/integrations/index.html |
Hi there! Any plan to publish the official Java lib with cross-compile native binaries to maven central? It would be fun to add it into a JDBC driver, so that user can issue PRQL in addition to SQL in popular database client like DBeaver/DataGrip :)
I noticed https://repo1.maven.org/maven2/io/github/doki23/prql-java/0.0.3/, but unfortunately it does not have native binary for mac. Apart from that, the Java package should be changed to
org.prqllang
, right?cc: @doki23
The text was updated successfully, but these errors were encountered: