Check if container exists in database
Arguments
- src
Source object, result of call to any of functions
src_mongo()
,src_sqlite()
,src_elastic()
,src_couchdb()
orsrc_postgres()
- key
(character) A key as name of the container (corresponds to parameter
collection
for MongoDB,dbname
for CouchDB,index
for Elasticsearch and to a table name for SQLite and for PostgreSQL)- ...
Passed to functions:
MongoDB: count() in
mongolite::mongo()
RSQLite:
DBI::dbListTables()
Elasticsearch:
elastic::index_exists()
CouchDB:
sofa::db_info()
PostgreSQL:
DBI::dbListTables()
DuckDB:
DBI::dbListTables()
Examples
if (FALSE) {
src <- src_sqlite()
docdb_exists(src, "nonexistingcontainer")
docdb_create(src, "mtcars", mtcars)
docdb_exists(src, "mtcars")
}