sn_connect_to_db: Return a connection to be used for db

View source: R/db.R

sn_connect_to_dbR Documentation

Return a connection to be used for db

Description

Return a connection to be used for db

Usage

sn_connect_to_db(connection = NULL, type = "osm", country = NULL)

Arguments

connection

Defaults to NULL. If NULL, uses local SQLite database. If given, must be a connection object (see example)

country

Defaults to NULL.

Value

A connection object.

Examples


if (interactive()) {
  cache_connection <- DBI::dbConnect(
    RSQLite::SQLite(), # or e.g. odbc::odbc(),
    Driver =  ":memory:", # or e.g. "MariaDB",
    Host = "localhost",
    database = "example_db",
    UID = "example_user",
    PWD = "example_pwd"
  )
  sn_connect_to_db(cache_connection)
}



giocomai/streetnamer documentation built on Oct. 14, 2023, 6:27 p.m.