Linux command
prqlc 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Compile PRQL to SQL
prqlc compile [query.prql]
Compile from stdin
echo "from employees | select name" | prqlc compile
Format PRQL
prqlc fmt [query.prql]
Output to file
prqlc compile [query.prql] -o [output.sql]
说明
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.
参数
- compile
- Compile PRQL to SQL.
- fmt
- Format PRQL code.
- -o _FILE_
- Output file.
- --target _DB_
- Target database.
FAQ
What is the prqlc command used for?
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.
How do I run a basic prqlc example?
Run `prqlc compile [query.prql]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does compile do in prqlc?
Compile PRQL to SQL.