PRQL allows specifying a dialect at the top of the query, which allows PRQL to compile to a database-specific SQL flavor.
prql dialect:postgres from employees sort age take 10
SELECT employees.* FROM employees ORDER BY age LIMIT 10
prql dialect:mssql from employees sort age take 10
SELECT TOP (10) employees.* FROM employees ORDER BY age
Note that dialect support is very early — most differences are not implemented, and most dialects’ implementations are identical to
generic’s. Contributions are very welcome.
PRQL allows specifying a version of the language in the PRQL header, like:
When the functionality is implemented, it will allow the language to evolve without breaking existing queries.