if (FALSE) { # requireNamespace("RSQLite", quietly = TRUE)
conn <- get_connection()
m <- mtcars %>%
dplyr::mutate(
"from_ts" = dplyr::if_else(dplyr::row_number() > 10,
as.Date("2020-01-01"),
as.Date("2021-01-01")),
"until_ts" = as.Date(NA))
dplyr::copy_to(conn, m, name = "mtcars", temporary = FALSE)
q <- dplyr::tbl(conn, id("mtcars", conn))
nrow(slice_time(q, "2020-01-01")) # 10
nrow(slice_time(q, "2021-01-01")) # nrow(mtcars)
close_connection(conn)
}
Run the code above in your browser using DataLab