Skip to content

Commit

Permalink
docs: Correct line break details in book (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Jun 20, 2023
1 parent 762b9ef commit b6b8c1f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
12 changes: 11 additions & 1 deletion web/book/src/syntax/pipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ from employees | filter department == "Product" | select {first_name, last_name}

A line-break doesn't create a pipeline in a couple of cases:

- within a list (e.g. the `derive` examples below),
- within a tuple
- within an array
- when the following line is a new statement, which starts with a keyword of
`func`, `let` or `from`.

```prql
from [ # Line break OK in an array
{a=2, b=3}
]
derive { # Line break OK in a tuple
c = 2 * a,
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
source: web/book/tests/documentation/book.rs
expression: "from [ # Line break OK in an array\n {a=2, b=3}\n]\nderive { # Line break OK in a tuple\n c = 2 * a,\n}\n"
---
WITH table_0 AS (
SELECT
2 AS a,
3 AS b
)
SELECT
a,
b,
2 * a AS c
FROM
table_0

0 comments on commit b6b8c1f

Please sign in to comment.