PRQL compiler CLI — prqlc
prqlc
serves as a CLI for the PRQL compiler. It is a single, dependency-free
binary that compiles PRQL into SQL.
Usage
prqlc compile
This command works as a filter that compiles a PRQL string into an SQL string.
|
A PRQL query can be executed with CLI tools compatible with SQL,, such as DuckDB CLI.
| |
Executing this command without any argument will start interactive mode,
allowing a PRQL query to be written interactively. In this mode, after writing
PRQL and press Ctrl-d
(Linux, macOS) or Ctrl-z
(Windows) to display the
compiled SQL.
Just like when using it as a filter, SQL string output can be passed to the DuckDB CLI and similar tools.
|
Installation
via Homebrew (macOS, Linux)
From GitHub release page
Precompiled binaries are available for Linux, macOS, and Windows on the PRQL release page.
From source
# From crates.io
# From a local PRQL repository
Shell completions
The prqlc shell-completion
command prints a shell completion script for
supported shells, and saving the printed scripts to files makes for shells to
load completions for each session.
Bash
For Linux:
For macOS:
fish
PowerShell
mkdir -Path (Split-Path -Parent $profile) -ErrorAction SilentlyContinue
prqlc shell-completion powershell >path/to/prqlc.ps1
echo 'Invoke-Expression -Command path/to/prqlc.ps1' >>$profile
zsh
Ensure that the following lines are present in ~/.zshrc
:
Helpers
Cheat sheets for prqlc
are available on various websites and with various
tools.
tldr
(on the web)eg