make_context {DBItest} | R Documentation |
Test contexts
Description
Create a test context, set and query the default context.
Usage
make_context(
drv,
connect_args = NULL,
set_as_default = TRUE,
tweaks = NULL,
name = NULL,
default_skip = NULL
)
set_default_context(ctx)
get_default_context()
Arguments
drv |
|
connect_args |
|
set_as_default |
|
tweaks |
|
name |
|
default_skip |
|
ctx |
|
Value
[DBItest_context]
A test context, for
set_default_context
the previous default context (invisibly) or
NULL
.
Examples
make_context(
new(
"DBIConnector",
.drv = RSQLite::SQLite(),
.conn_args = list(dbname = tempfile("DBItest", fileext = ".sqlite"))
),
tweaks = tweaks(
constructor_relax_args = TRUE,
placeholder_pattern = c("?", "$1", "$name", ":name"),
date_cast = function(x) paste0("'", x, "'"),
time_cast = function(x) paste0("'", x, "'"),
timestamp_cast = function(x) paste0("'", x, "'"),
logical_return = function(x) as.integer(x),
date_typed = FALSE,
time_typed = FALSE,
timestamp_typed = FALSE
),
default_skip = c("roundtrip_date", "roundtrip_timestamp")
)
[Package DBItest version 1.8.1 Index]