dbConnect2: Connect to SQLite-database

Description Usage Arguments Value See Also

View source: R/IO_databases.R

Description

A wrapper around dbConnect that catches errors and attempts to connect up to repeats before giving up.

Usage

1
2
3
4
5
6
7
8
dbConnect2(
  dbname,
  flags = SQLITE_RW,
  verbose = FALSE,
  repeats = 10L,
  sleep_s = 5,
  seed = NA
)

Arguments

dbname

A character string. The path including name to the database.

flags

An integer value. See dbConnect. Defaults to read/write mode.

verbose

A logical value.

repeats

An integer value. The maximum number of failed attempts to execute the SQL statement(s) if the database is locked.

sleep_s

A numeric value. The average number to sleep before attempting to execute the SQL statement(s) if the database was locked.

seed

An R object. Passed to set.seed if not NA.

Value

A SQLiteConnection object on success; an object of class try-error on failure.

See Also

dbConnect


Burke-Lauenroth-Lab/rSFSW2 documentation built on Aug. 14, 2020, 5:20 p.m.