# First create a database in a temporary directory
db <- create_db(tempdir(), "mydb.db")
# Then close it
close_db(db)
# You can even try to close a database that is already closed. This will not trigger an error.
close_db(db)
# Cleanup
file.remove(file.path(tempdir(), "mydb.db"))
Run the code above in your browser using DataLab