PRQL / prql-query

Query and transform data with PRQL
Apache License 2.0
126 stars 7 forks source link

method to show_query to show what SQL PRQL will generate? #31

Closed cboettig closed 1 year ago

cboettig commented 1 year ago

Is there a method similar to dplyr::show_query() which will show the corresponding SQL that is generated by a PRQL command chain? I find this can be very helpful, especially when seeking to become more familiar with the PRQL / piped syntax!

eitsupi commented 1 year ago

@cboettig Have you tried prqlc? It is a CLI tool that provides simple query compilation.

We need to build it on our side as there are no binaries in the GitHub release......

$ cargo install prqlc
$ echo 'from hello | select world' | prqlc compile
SELECT
  world
FROM
  hello

-- Generated by PRQL compiler version:0.6.1 (https://prql-lang.org)