Skip to content

0.6.0

Compare
Choose a tag to compare
@max-sixty max-sixty released this 09 Mar 06:34
· 2093 commits to main since this release
9838953

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 to WITH RECURSIVE. We expect changes and refinements in upcoming releases. (#1642, @aljazerzen)
  • Rename the experimental switch function to case given it more closely matches the traditional semantics of case. (@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 than or (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 to prqlc 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 as 0800 in @2020-01-01T13:19:55-0800 (@max-sixty, #1991).
  • Add std.upper and std.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:

Integrations:

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: