Checks if database folder exists, if not returns an informative message
Source:R/cas_database.R
cas_check_db_folder.Rd
Checks if database folder exists, if not returns an informative message
See also
Other database functions:
cas_check_use_db()
,
cas_connect_to_db()
,
cas_create_db_folder()
,
cas_disable_db()
,
cas_disconnect_from_db()
,
cas_enable_db()
,
cas_get_db_settings()
,
cas_read_from_db()
,
cas_set_db()
,
cas_set_db_folder()
,
cas_write_to_db()
Examples
# If database folder does not exist, it throws an error
tryCatch(cas_check_db_folder(),
error = function(e) {
return(e)
}
)
#> <usethis_error: Database folder does not exist. Set it with `cas_set_db_folder()` and create it with `cas_create_db_folder()`>
# Create database folder
cas_set_db_folder(path = fs::path(
tempdir(),
"cas_db_folder"
))
cas_create_db_folder(ask = FALSE)
cas_check_db_folder()
#> [1] TRUE