safeSQLiteConnect | R Documentation |
In this package, all connections to sqlite database files are created by this function.
safeSQLiteConnect(path, create = FALSE, busyTimeout = 300,
cacheSize = 200)
path |
path to database |
create |
should database be created if it doesn't already exist; default: FALSE |
busyTimeout |
value for busy_timout handler, in seconds; default: 300. A positive value causes the function to wait for another process to unlock the database, rather than returning immediately with an error. |
cacheSize |
size of sqlite page cache to use, in MBytes. default: 200 |
This avoids the locking issue with the typical use of
dbConnect(RSQLite::SQLite(), ...)
, which connects and immediately
tries to set synchronous mode, unless synchronous=NULL
is specified.
If the database is locked, the connection fails before pragma busy_timeout
can be used to set a timeout handler.
a DBI:dbConnection to the sqlite database, or NULL on failure
parameters, return value, and semantics are identical to
dplyr::src_sqlite
except that a locked sqlite database
will be handled gracefully with retries.
minor changes from dplyr::src_sqlite by John Brzustowski
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.