0.6.0
0.6.0 introduces a rewritten parser, giving us the ability to dramatically improve error messages, renames switch
to case
and includes lots of minor improvements and fixes. It also introduces loop
, which compiles to WITH RECURSIVE
, as a highly experimental feature.
There are a few cases of breaking changes, including switching switch
to case
, in case that's confusing. There are also some minor parsing changes outlined below.
This release has 108 commits from 11 contributors. Selected changes:
Features:
- Add a (highly experimental)
loop
language feature, which translates toWITH RECURSIVE
. We expect changes and refinements in upcoming releases. (#1642, @aljazerzen) - Rename the experimental
switch
function tocase
given it more closely matches the traditional semantics ofcase
. (@max-sixty, #2036) - Change the
case
syntax to use=>
instead of->
to distinguish it from function syntax. - Convert parser from pest to Chumsky (@aljazerzen, #1818)
- Improved error messages, and the potential to make even better in the future. Many of these improvements come from error recovery.
- String escapes (
\n \t
). - Raw strings that don't escape backslashes.
- String interpolations can only contain identifiers and not any expression.
- Operator associativity has been changed from right-to-left to left-to-right to be more similar to other conventional languages.
and
now has a higher precedence thanor
(of same reason as the previous point).- Dates, times and timestamps have stricter parsing rules.
let
,func
,prql
,case
are now treated as keywords.- Float literals without fraction part are not allowed anymore (
1.
).
- Add a
--format
option toprqlc parse
which can return the AST in YAML (@max-sixty, #1962) - A new compile target
"sql.any"
. When"sql.any"
is used as the target of the compile function's option, the target contained in the query header will be used. (@aljazerzen, #1995) - Support for SQL parameters with similar syntax (#1957, @aljazerzen)
- Allow
:
to be elided in timezones, such as0800
in@2020-01-01T13:19:55-0800
(@max-sixty, #1991). - Add
std.upper
andstd.lower
functions for changing string cases (@Jelenkee, #2019).
Fixes:
prqlc compile
returns a non-zero exit code for invalid queries. (@max-sixty, #1924)- Identifiers can contain any alphabetic unicode characters (@max-sixty, #2003)
Documentation:
- Operator precedence (@aljazerzen, #1818)
- Error messages for invalid queries are displayed in the book (@max-sixty, #2015)
Integrations:
- [prql-php] Added PHP bindings. (@vanillajonathan, #1860)
- [prql-dotnet] Added .NET bindings. (@vanillajonathan, #1917)
- [prql-lib] Added C header file. (@vanillajonathan, #1879)
- Added a workflow building a
.deb
on each release. (Note that it's not yet published on each release). (@vanillajonathan, #1883) - Added a workflow building a Snap package on each release. (@vanillajonathan, #1881)
Internal changes:
- Test that the output of our nascent autoformatter can be successfully compiled into SQL. Failing examples are now clearly labeled. (@max-sixty, #2016)
- Definition files have been added to configure Dev Containers for Rust development environment. (@eitsupi, #1893, #2025, #2028)
New Contributors:
- @linux-china, with #1971
- @Jelenkee, with #2019