Skip to content

Commit

Permalink
Merge branch 'docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed May 4, 2021
2 parents 33637f9 + 191f3fb commit 54cd165
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vignettes/howto-dm-copy.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ my_dm_total_computed$total_loans %>%
``````

```{r echo = FALSE, eval = TRUE}
remote_name_total_loans <- ""
remote_name_total_loans <- remote_name(my_dm_total_computed$total_loans)
# https://github.com/tidyverse/dbplyr/issues/639, https://github.com/tidyverse/dbplyr/pull/649
remote_name_total_loans <- "dbplyr_001"
stopifnot(grepl(remote_name_total_loans, sql_render(my_dm_total_computed$total_loans), fixed = TRUE))
```

Note the differences in queries returned by `sql_render()`.
`my_dm_total$total_loans` is still being lazily evaluated and the full query constructed from the chain of operations that generated it, and is required to run to access it, is still in place.
Contrast that with `my_dm_total_computed$total_loans` where the query has been realized and accessing its rows requires a simple `SELECT *` statement.
The table name, `` `r remote_name_total_loans` ``, was automatically generated as the `name` argument was not supplied.
The table name, `` `r remote_name_total_loans` ``, was automatically generated as the `name` argument was not supplied to `compute()`.

The default is to create a temporary table.
If you want results to persist across sessions in permanent tables, `compute()` must be called with the argument `temporary = FALSE` and a table name for the `name` argument.
Expand Down

0 comments on commit 54cd165

Please sign in to comment.