prql-java

prql-java offers Java bindings to the prql-compiler Rust library. It exposes a Java native method public static native String toSql(String query).

It’s still at an early stage, and currently requires compiling locally, and isn’t published to Maven. Contributions are welcome.

Installation

  1. <dependency>
  2. <groupId>org.prqllang</groupId>
  3. <artifactId>prql-java</artifactId>
  4. <version>${PRQL_VERSION}</version>
  5. </dependency>

Usage

  1. import org.prqllang.prql4j.PrqlCompiler;
  2. class Main {
  3. public static void main(String[] args) {
  4. String sql = PrqlCompiler.toSql("from table");
  5. System.out.println(sql);
  6. }
  7. }