Learn R Programming

easydb (version 1.1.0)

easydb_disconnect: Disconnect from database

Description

Simple wrapper around [DBI::dbDisconnect()]

Usage

easydb_disconnect(connection)

Value

Invisibly returns TRUE

Arguments

connection

coneection generated by [easydb_connect]

Examples

Run this code
if(interactive()) {

  # Choose config file path
  # Do NOT use tempfile in practice.
  # Instead, choose a fixed location such as '~/.easydb'
  config <- tempfile('.example_config')

  # Initialise config file
  easydb_init(config)

  # Connect to SQLite database
  path_to_db <- system.file(package = 'easydb', 'testdbs/mtcars.sqlite')
  con <- easydb_connect(dbname = path_to_db, config_file = config)

  # Disconnect from database when finished
  easydb_disconnect(con)
}

Run the code above in your browser using DataLab