Skip to contents

Connect temporarily to a database.

Usage

db_temp_connect(db_path, code, drv = RSQLite::SQLite())

Arguments

db_path

Path to the database.

code

Code to execute with the temporary connection.

drv

The DB driver to use. Standard the SQLite driver.

Value

Nothing will be returned by default.

Examples

 library(DBI)
 db_temp_connect(tempfile(), DBI::dbWriteTable(con, "test_table", mtcars))