con <- DBI::dbConnect(duckdb::duckdb())
validate_database_exists(con, "test_db")Check if a Database Exists
Source: R/utils-db.R
Checks whether a database with the specified name exists on the current connection.
Usage
validate_database_exists(.con, database_name)Arguments
Value
Logical TRUE if the database exists, FALSE otherwise.
Details
This function queries the available databases for the connection using motherduck::list_all_databases() and performs an exact match check. Returns TRUE if the database exists, FALSE otherwise.