Skip to content

Releases: PRQL/prql

0.5.2

19 Feb 02:33
ee67048

Choose a tag to compare

0.5.2 is a tiny release to fix an build issue in yesterday's prql-js 0.5.1 release.

This release has 7 commits from 2 contributors.

New Contributors:

0.5.1

17 Feb 19:56
2d93912

Choose a tag to compare

0.5.1 contains a few fixes, and another change to how bindings handle default target / dialects.

This release has 53 commits from 7 contributors. Selected changes:

Fixes:

  • Delegate dividing literal integers to the DB. Previously integer division was executed during PRQL compilation, which could be confusing given that behavior is different across DBs. Other arithmetic operations are still executed during compilation. (@max-sixty, #1747)

Documentation:

Integrations:

  • [prql-js] Default compile target changed from Sql(Generic) to Sql(None). (@eitsupi, #1856)
  • [prql-python] Compilation options can now be specified from Python. (@eitsupi, #1807)
  • [prql-python] Default compile target changed from Sql(Generic) to Sql(None). (@eitsupi, #1861)

New Contributors:

0.5.0

09 Feb 02:44
d6713be

Choose a tag to compare

0.5.0 contains a few fixes, some improvements to bindings, lots of docs improvements, and some work on forthcoming features. It contains one breaking change in the compiler's Options interface.

This release has 74 commits from 12 contributors. Selected changes:

Features:

  • Change public API to use target instead of dialect in preparation for future work (@aljazerzen, #1684)
  • prqlc watch command which watches filesystem for changes and compiles .prql files to .sql (@aljazerzen, #1708)

Fixes:

Documentation:

  • Add a documentation test for prql-compiler, update prql-compiler README, and include the README in the prql book section for Rust bindings. The code examples in the README are included and tested as doctests in the prql-compiler (@nkicg6, #1679)

Internal changes:

  • Add tests for all PRQL website examples to prql-python to ensure compiled results match expected SQL (@nkicg6, #1719)

New Contributors:

0.4.2

26 Jan 05:10
327298a

Choose a tag to compare

0.4.2 has 38 commits from 12 contributors.

Features:

  • New from_text format-arg string-arg function that supports JSON and CSV formats. format-arg can be format:csv or format:json`. string-arg can be a string in any format. (@aljazerzen & @snth, #1514)

    from_text format:csv """
    a,b,c
    1,2,3
    4,5,6
    """
    
    from_text format:json '''
        [{"a": 1, "b": "x", "c": false }, {"a": 4, "b": "y", "c": null }]
    '''
    
    from_text format:json '''
    {
        "columns": ["a", "b", "c"],
        "data": [
            [1, "x", false],
            [4, "y", null]
        ]
    }
    '''
    

    For now, the argument is limited to string constants.

Fixes

New Contributors

0.4.1

19 Jan 06:06
a19944f

Choose a tag to compare

0.4.1 comes a few days after 0.4.0, with a couple of features and the release of prqlc, the CLI crate.

0.4.1 has 35 commits from 6 contributors.

Features:

  • Inferred column names include the relation name (@aljazerzen, #1550):

    from albums
    select title # name used to be inferred as title only
    select albums.title # so using albums was not possible here
    
  • Quoted identifiers such as dir/*.parquet are passed through to SQL. (@max-sixty, #1516).

  • The CLI is installed with cargo install prqlc. The binary was renamed in 0.4.0 but required an additional --features flag, which has been removed in favor of this new crate (@max-sixty & @aljazerzen, #1549).

New Contributors:

0.4.0

16 Jan 04:50
a212519

Choose a tag to compare

0.4.0 brings lots of new features including switch, select ![] and numbers with underscores. We have initial (unpublished) bindings to Elixir. And there's the usual improvements to fixes & documentation (only a minority are listed below in this release).

0.4.0 also has some breaking changes: table is let, dialect is renamed to target, and the compiler's API has changed. Full details below.

Features:

  • Defining a temporary table is now expressed as let rather than table (@aljazerzen, #1315). See the tables docs for details.

  • Experimental: The switch function sets a variable to a value based on one of several expressions (@aljazerzen, #1278).

    derive var = switch [
      score <= 10 -> "low",
      score <= 30 -> "medium",
      score <= 70 -> "high",
      true -> "very high",
    ]
    

    ...compiles to:

    SELECT
      *,
      CASE
        WHEN score <= 10 THEN 'low'
        WHEN score <= 30 THEN 'medium'
        WHEN score <= 70 THEN 'high'
        ELSE 'very high'
      END AS var
    FROM
      bar

    Check out the switch docs for more details.

  • Experimental: Columns can be excluded by name with select (@aljazerzen, #1329)

    from albums
    select ![title, composer]
    
  • Experimental: append transform, equivalent to UNION ALL in SQL. (@aljazerzen, #894)

    from employees
    append managers
    

    Check out the append docs for more details.

  • Numbers can contain underscores, which can make reading long numbers easier (@max-sixty, #1467):

    from numbers
    select [
        small = 1.000_000_1,
        big = 5_000_000,
    ]
    
  • The SQL output contains a comment with the PRQL compiler version (@aljazerzen, #1322)

  • dialect is renamed to target, and its values are prefixed with sql. (@max-sixty, #1388); for example:

    prql target:sql.bigquery  # previously was `dialect:bigquery`
    
    from employees
    

    This gives us the flexibility to target other languages than SQL in the long term.

  • Tables definitions can contain a bare s-string (@max-sixty, #1422), which enables us to include a full CTE of SQL, for example:

    let grouping = s"""
      SELECT SUM(a)
      FROM tbl
      GROUP BY
        GROUPING SETS
        ((b, c, d), (d), (b, d))
    """
    
  • Ranges supplied to in can be half-open (@aljazerzen, #1330).

  • The crate's external API has changed to allow for compiling to intermediate representation. This also affects bindings. See prql_compiler docs for more details.

Fixes:

[This release, the changelog only contains a subset of fixes]

Documentation:

[This release, the changelog only contains a subset of documentation improvements]

Web:

  • The playground allows querying some sample data. As before, the result updates
    on every keystroke. (@aljazerzen, #1305)

Integrations:

[This release, the changelog only contains a subset of integration improvements]

Internal changes:

[This release, the changelog only contains a subset of internal changes]

New contributors:

0.3.1

04 Dec 00:53
6dbf1fc

Choose a tag to compare

0.3.1 brings a couple of small improvements and fixes.

Features:

  • Support for using s-strings for from (#1197, @aljazerzen)
    from s"SELECT * FROM employees WHERE foo > 5"
  • Helpful error message when referencing a table in an s-string (#1203, @aljazerzen)

Fixes:

Internal:

  • Update Github Actions and Workflows to current version numbers (and avoid using Node 12) (#1201)

0.3.0

30 Nov 07:18
928d479

Choose a tag to compare

🎉 0.3.0 is the biggest ever change in PRQL's compiler 🎉. It rewrites much of the internals: the compiler now has a semantic understanding of expressions, including resolving names & building a DAG of column lineage.

While the immediate changes to the language are modest — some long-running bugs are fixed — this unlocks beginning development of many of the broad features we've had ambitions for, such as type-checking & auto-complete. And it simplifies building our next language features, such as match-case expressions, unions & table expressions.

@aljazerzen has (mostly single-handedly) done this work over the past few months. The project owes him immense appreciation.

Breaking changes:

We've had to make some modest breaking changes for 0.3:

  • Pipelines must start with from. For example, a pipeline with only derive foo = 5, with no from transform, is no longer valid. Depending on demand for this feature, it would be possible to add this back.

  • Shared column names now require == in a join. For example:

    from employees
    -join positions [id]
    +join positions [==id]

    The existing approach is ambiguous to the compiler — id could be a boolean column.

  • Table references containing periods must be surrounded by backticks. For example, when referencing a schema name:

    -from public.sometable
    +from `public.sometable`

Features:

Fixes:

Documentation:

Internal changes:

0.2.11

20 Nov 23:30
eff5f98

Choose a tag to compare

0.2.11 contains a few helpful fixes.

Work continues on our semantic refactor — look out for 0.3.0 soon! Many thanks to @aljazerzen for his continued contributions to this.

Note: 0.2.10 was skipped due to this maintainer's inability to read his own docs on bumping versions...

Features:

Fixes:

  • Fix nesting of expressions with equal binding strength and left associativity,
    such as a - (b - c) (@max-sixty, #1136)
  • Retain floats without significant digits as floats (@max-sixty, #1141)

Documentation:

Internal changes:

0.2.9

14 Oct 17:51
09c3d20

Choose a tag to compare

0.2.9 is a small release containing a bug fix for empty strings.

Fixes: