Alternative languages (PRQL, PQL)
TL;DR
Set the language to PRQL
anyquery --prql
Set the language to PQL
anyquery --pql
Introduction
Anyquery supports out-of-the-box alternative languages to SQL. You can use PRQL or PQL to query your data. PRQL is an attempt to make SQL more human-readable, and PQL is language similar to Microsoft Kusto Query Language (KQL).
PRQL
PRQL allows you to write queries in a more human-readable way. FROM statement is at the beginning of the query, and the SELECT statement is at the end (which makes sense when writing a query). PRQL is available in the shell mode, stdin mode, and query as a flag argument.
from github_stars_from_userfilter stargazers_count > 1000 && user == 'codediodeio'sort starred_atselect { repo_name = f"{owner}/{name}", starred_at, stargazers_count}take 10
To enable PRQL, run:
anyquery --prql
and install the prqlc
CLI: https://prql-lang.org/book/project/integrations/prqlc-cli.html#installation
Or once the shell mode is open, run:
.language prql-- To switch back to SQL, run:.language
PQL
PQL is a language that tries to bridge the gap between proprietary languages like KQL, Splunk SPL, and SQL. PQL is available in the shell mode, stdin mode, and query as a flag argument.
github_stars_from_user| where stargazers_count > 1000 and user == 'codediodeio'| sort by starred_at| project repo_name = strcat(owner, '/', name), starred_at, stargazers_count| take 10
To enable PQL, run:
anyquery --pql
Or once the shell mode is open, run:
.language pql-- To switch back to SQL, run:.language