> skip_if_local_src()
> data <- test_src_frame(select = 1:3, where = letters[c(1:2, NA)], exists = 0.5 +
+   0:2)
> data
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5

> rows_insert(data, tibble(select = 4, where = "z"))
Error: `x` and `y` must share the same src, set `copy` = TRUE (may be slow).

> rows_insert(data, test_src_frame(select = 4, where = "z"))
Message: Result is returned as lazy table. Use `in_place = FALSE` to mute this message, or `in_place = TRUE` to write to the underlying table.

  select where exists
   <dbl> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5
4      4 z       NA  

> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5

> suppressMessages(rows_update(data, tibble(select = 2:3, where = "w"), copy = TRUE,
+ in_place = FALSE))
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 w        1.5
3      3 w        2.5

> suppressMessages(rows_update(data, tibble(select = 2:3), copy = TRUE, in_place = FALSE))
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5

> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5

> rows_insert(data, test_src_frame(select = 4, where = "z"), in_place = FALSE)
  select where exists
   <dbl> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5
4      4 z       NA  

> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5

> rows_update(data, test_src_frame(select = 0L, where = "a"), by = "where",
+ in_place = FALSE)
  select where exists
   <int> <chr>  <dbl>
1      2 b        1.5
2      3 <NA>     2.5
3      0 a        0.5

> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5

> rows_insert(data, test_src_frame(select = 4, where = "z"), in_place = TRUE)
> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 b        1.5
3      3 <NA>     2.5
4      4 z       NA  

> rows_update(data, test_src_frame(select = 2:3, where = "w"), in_place = TRUE)
> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 w        1.5
3      3 w        2.5
4      4 z       NA  

> rows_update(data, test_src_frame(select = 2:3), in_place = TRUE)
> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      1 a        0.5
2      2 w        1.5
3      3 w        2.5
4      4 z       NA  

> rows_update(data, test_src_frame(select = 0L, where = "a"), by = "where",
+ in_place = TRUE)
> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      0 a        0.5
2      2 w        1.5
3      3 w        2.5
4      4 z       NA  

> rows_truncate(data, in_place = FALSE)
# ... with 3 variables: select <int>, where <chr>, exists <dbl>

> data %>% arrange(select)
  select where exists
   <int> <chr>  <dbl>
1      0 a        0.5
2      2 w        1.5
3      3 w        2.5
4      4 z       NA  

> rows_truncate(data, in_place = TRUE)
> data %>% arrange(select)
# ... with 3 variables: select <int>, where <chr>, exists <dbl>

