We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
test_that("import_all_flobs works with .", { conn <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") teardown(DBI::dbDisconnect(conn)) # 2 column pk DBI::dbExecute(conn, "CREATE TABLE df ( char TEXT NOT NULL, num REAL NOT NULL, PRIMARY KEY (char, num))") # one column pk with empty DBI::dbExecute(conn, "CREATE TABLE df2 ( char TEXT PRIMARY KEY NOT NULL)") # one column pk with two blob cols DBI::dbWriteTable(conn, "df", data.frame(char = c("a", "a", "b"), num = c(1, 2.1, 1)), append = TRUE) DBI::dbWriteTable(conn, "df2", data.frame(char = c("a", "b")), append = TRUE) flob <- flobr::flob_obj write_flob(flob, "New", "df", key = data.frame(char = "a", num = 1), conn) write_flob(flob, "New2", "df", key = data.frame(char = "a", num = 2.1), conn) write_flob(flob, "New", "df", key = data.frame(char = "b"), conn) write_flob(flob, "New", "df2", key = data.frame(char = "b"), conn) path <- file.path(tempdir(), "dbflobr") unlink(path, recursive = TRUE) dir.create(path) save_all_flobs(conn = conn, dir = path, sub = NA) expect_identical(import_all_flobs(conn, path, exists = TRUE, sub = TRUE), list(`df/New` = c(`a_-_1` = FALSE, `b_-_1` = FALSE), `df/New2` = c(`a_-_2.1` = FALSE), `df2/New` = c(b = FALSE))) # why is it false for a_-_2.1!! (should be true) expect_identical(import_all_flobs(conn, path, exists = TRUE, replace = TRUE, sub = TRUE), list(`df/New` = c(`a_-_1` = TRUE, `b_-_1` = TRUE), `df/New2` = c(`a_-_2.1` = FALSE), `df2/New` = c(b = TRUE))) list.files(path, recursive = TRUE, include.dirs = TRUE) import_flobs("New2", "df", conn = conn, dir = file.path(path, "df", "New2"), sub = TRUE, exists = TRUE, replace = TRUE) expect_identical(import_all_flobs(conn, path, exists = TRUE, sub = NA), list(`df/New` = c(`a_-_1` = FALSE, `a_-_2.1` = TRUE, `b_-_1` = FALSE ), `df/New2` = c(`a_-_1` = TRUE, `a_-_2.1` = FALSE, `b_-_1` = TRUE ), `df2/New` = c(a = TRUE, b = FALSE))) # why is it false for second a_-_2.1!! (should be true) expect_identical(import_all_flobs(conn, path, exists = TRUE, replace = TRUE, sub = NA), list(`df/New` = c(`a_-_1` = TRUE, `a_-_2.1` = TRUE, `b_-_1` = TRUE ), `df/New2` = c(`a_-_1` = TRUE, `a_-_2.1` = FALSE, `b_-_1` = TRUE ), `df2/New` = c(a = TRUE, b = TRUE))) })
The text was updated successfully, but these errors were encountered:
joethorley
No branches or pull requests
The text was updated successfully, but these errors were encountered: