Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add note to #3292 #3295

Merged
merged 1 commit into from
Aug 9, 2023
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
29 changes: 16 additions & 13 deletions web/book/src/reference/stdlib/transforms/from.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@

Specifies a data source.

```prql no-eval
from table_reference
```prql
from artists
```

Table names containing schemas, keywords, or special characters
[need to be contained within backticks](../../syntax/keywords.md#quoting).
`default_db.tablename` can be used if the table name matches a function from the
standard library.
To introduce an alias, use an assign expression:

```prql
default_db.group
take 1
from e = employees
select e.first_name
```

## Examples
Table names containing spaces or special characters
[need to be contained within backticks](../../syntax/keywords.md#quoting):

```prql
from employees
from `artist tracks`
```

To introduce an alias, use an assign expression:
`default_db.tablename` can be used if the table name matches a function from the
standard library.

```admonish note
We realize this is an awkward workaround. Track & 👍 [#3271](https://github.com/PRQL/prql/issues/3271) for resolving this.
```

```prql
from e = employees
select e.first_name
default_db.group # in place of `from group`
take 1
```
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
source: web/book/tests/documentation/book.rs
expression: "default_db.group\ntake 1\n"
expression: "from artists\n"
---
SELECT
*
FROM
"group"
LIMIT
1
artists

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
source: web/book/tests/documentation/book.rs
expression: "from e = employees\nselect e.first_name\n"
---
SELECT
first_name
FROM
employees AS e

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
source: web/book/tests/documentation/book.rs
expression: "from `artist tracks`\n"
---
SELECT
*
FROM
"artist tracks"

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
source: web/book/tests/documentation/book.rs
expression: "default_db.group # in place of `from group`\ntake 1\n"
---
SELECT
*
FROM
"group"
LIMIT
1

Loading