LinuxCommandLibrary

prqlc

Compile PRQL queries to SQL

TLDR

Compile PRQL to SQL

$ prqlc compile [query.prql]
copy
Compile from stdin
$ echo "from employees | select name" | prqlc compile
copy
Format PRQL
$ prqlc fmt [query.prql]
copy
Output to file
$ prqlc compile [query.prql] -o [output.sql]
copy

SYNOPSIS

prqlc command [options] [file]

DESCRIPTION

prqlc is the compiler for PRQL (Pipelined Relational Query Language), a modern query language designed as a more readable and composable alternative to SQL. It transpiles PRQL source code into standard SQL that can be executed against any supported database.
PRQL uses a pipeline syntax where data transformations are chained with the pipe operator, making complex queries easier to read and write than equivalent nested SQL. The compiler supports multiple SQL dialects through the --target option, generating database-specific SQL for PostgreSQL, MySQL, SQLite, BigQuery, and others.
The fmt subcommand formats PRQL source code for consistent style, and the compiler accepts input from files or stdin for use in build pipelines.

PARAMETERS

compile

Compile PRQL to SQL.
fmt
Format PRQL code.
-o FILE
Output file.
--target DB
Target database.

CAVEATS

PRQL is experimental. Supports multiple SQL dialects.

HISTORY

PRQL was created as a modern alternative to SQL syntax.

SEE ALSO

psql(1), sqlite3(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community