
Last chance! 50% off unlimited learning
Sale ends in
This functions attempts to determine the existence of a given table. If a character input is given, matching is done heuristically assuming a "schema.table" notation. If no schema is implied in this case, the default schema is assumed.
table_exists(conn, db_table)# S3 method for DBIConnection
table_exists(conn, db_table)
TRUE
if db_table can be parsed to a table found in conn
.
(DBIConnection(1)
)
Connection object.
(id-like object(1)
)
A table specification (coercible by id()
).
if (FALSE) { # requireNamespace("RSQLite", quietly = TRUE)
conn <- get_connection()
dplyr::copy_to(conn, mtcars, name = "mtcars", temporary = FALSE)
dplyr::copy_to(conn, iris, name = "iris")
table_exists(conn, "mtcars") # TRUE
table_exists(conn, "iris") # FALSE
table_exists(conn, "temp.iris") # TRUE
close_connection(conn)
}
Run the code above in your browser using DataLab