memdb_frame() works like tibble::tibble(), but instead of creating a new data frame in R, it creates a table in src_memdb().

memdb_frame(..., .name = random_table_name())

src_memdb()

Arguments

...

A set of name-value pairs. Arguments are evaluated sequentially, so you can refer to previously created elements. These arguments are processed with rlang::quos() and support unquote via !! and unquote-splice via !!!. Use := to create columns that start with a dot.

.name

Name of table in database: defaults to a random name that's unlikely to conflict with an existing table.

Examples

library(dplyr) df <- memdb_frame(x = runif(100), y = runif(100)) df %>% arrange(x)
#> # Source: table<weaikfkbkz> [?? x 2] #> # Database: sqlite 3.22.0 [:memory:] #> # Ordered by: x #> x y #> <dbl> <dbl> #> 1 0.0115 0.288 #> 2 0.0201 0.751 #> 3 0.0280 0.383 #> 4 0.0281 0.00450 #> 5 0.0312 0.165 #> 6 0.0514 0.403 #> 7 0.0586 0.164 #> 8 0.0652 0.464 #> 9 0.0960 0.909 #> 10 0.149 0.322 #> # … with more rows
df %>% arrange(x) %>% show_query()
#> <SQL> #> SELECT * #> FROM `weaikfkbkz` #> ORDER BY `x`