Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- "web/**"
- ".github/workflows/build-web.yaml"
- "**.md"
workflow_call:

concurrency:
Expand Down
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ repos:
types: ["rust"]
# A regex searching sql files for either `prj-` or 'tgs-'.
entry: "dbg!"
- repo: local
hooks:
- id: prql-codeblock
name: Prevent prql codeblocks evaluating in book
description:
prql code blocks are evaluated and replaced in the book; instead use
`prql no-eval`
language: pygrep
entry: "```prql$"
files: 'CHANGELOG\.md$'

# This is quite strict, and doesn't fix a large enough share of the issues it
# finds, so we don't include it. But it's reasonable to run every now & again
# manually and take its fixes.
Expand Down
24 changes: 14 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,21 @@ This release has 74 commits from 12 contributors. Selected changes:
formats. _format-arg_ can be `format:csv` or `format:json`. _string-arg_ can
be a string in any format. (@aljazerzen & @snth, #1514)

```prql
```prql no-eval
from_text format:csv """
a,b,c
1,2,3
4,5,6
"""
```

```prql no-eval
from_text format:json '''
[{"a": 1, "b": "x", "c": false }, {"a": 4, "b": "y", "c": null }]
'''
```

```prql no-eval
from_text format:json '''{
"columns": ["a", "b", "c"],
"data": [
Expand Down Expand Up @@ -278,7 +282,7 @@ This release has 74 commits from 12 contributors. Selected changes:

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

```prql
```prql no-eval
from albums
select title # name used to be inferred as title only
select albums.title # so using albums was not possible here
Expand Down Expand Up @@ -317,7 +321,7 @@ below in this release).
a variable to a value based on one of several expressions (@aljazerzen,
#1278).

```prql
```prql no-eval
derive var = case [
score <= 10 -> "low",
score <= 30 -> "medium",
Expand Down Expand Up @@ -348,15 +352,15 @@ below in this release).
- _Experimental:_ Columns can be excluded by name with `select` (@aljazerzen,
#1329)

```prql
```prql no-eval
from albums
select ![title, composer]
```

- _Experimental:_ `append` transform, equivalent to `UNION ALL` in SQL.
(@aljazerzen, #894)

```prql
```prql no-eval
from employees
append managers
```
Expand All @@ -368,7 +372,7 @@ below in this release).
- Numbers can contain underscores, which can make reading long numbers easier
(@max-sixty, #1467):

```prql
```prql no-eval
from numbers
select [
small = 1.000_000_1,
Expand All @@ -381,7 +385,7 @@ below in this release).
- `dialect` is renamed to `target`, and its values are prefixed with `sql.`
(@max-sixty, #1388); for example:

```prql
```prql no-eval
prql target:sql.bigquery # previously was `dialect:bigquery`

from employees
Expand All @@ -393,7 +397,7 @@ below in this release).
- Tables definitions can contain a bare s-string (@max-sixty, #1422), which
enables us to include a full CTE of SQL, for example:

```prql
```prql no-eval
let grouping = s"""
SELECT SUM(a)
FROM tbl
Expand Down Expand Up @@ -470,7 +474,7 @@ improvements]

- Support for using s-strings for `from` (#1197, @aljazerzen)

```prql
```prql no-eval
from s"SELECT * FROM employees WHERE foo > 5"
```

Expand Down Expand Up @@ -614,7 +618,7 @@ fix rather than a breaking change in semantic versioning.
last; for example `round 2 foo_col` / `cast int foo`. This is consistent with
other functions, and makes piping possible:

```prql
```prql no-eval
derive [
gross_salary = (salary + payroll_tax | as int),
gross_salary_rounded = (gross_salary | round 0),
Expand Down
2 changes: 2 additions & 0 deletions web/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@
- [Name resolving](./internals/name-resolving.md)
- [Functions](./internals/functional-lang.md)
- [Syntax highlighting](./internals/syntax-highlighting.md)

- [Changelog](./changelog.md)
1 change: 1 addition & 0 deletions web/book/src/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#include ../../../CHANGELOG.md}}
2 changes: 1 addition & 1 deletion web/book/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn replace_examples(text: &str) -> Result<String> {
cmark_acc.push(event.to_owned());
continue;
};
if !lang_tags.contains(&"prql".to_string()) {
if !lang_tags.contains(&"prql".to_string()) || lang_tags.contains(&"no-eval".to_string()) {
cmark_acc.push(event.to_owned());
continue;
}
Expand Down