Set/get the name of the default connection to use
Source:R/set_default_conn_name.R
set_default_conn_name.Rd
Set/get the name of the default connection to use
Examples
library(sqlhelper)
connect(
system.file("examples/sqlhelper_db_conf.yml",
package="sqlhelper"),
exclusive = TRUE
)
connection_info()
#> # A tibble: 2 × 7
#> name description live default driver conn_str pool
#> <chr> <chr> <lgl> <lgl> <glue> <chr> <lgl>
#> 1 pool_sqlite A pooled connection to an i… TRUE FALSE RSQLi… NA TRUE
#> 2 simple_sqlite A simple connection to an i… TRUE TRUE RSQLi… NA FALSE
get_default_conn_name()
#> [1] "simple_sqlite"
set_default_conn_name("pool_sqlite")
connection_info()
#> # A tibble: 2 × 7
#> name description live default driver conn_str pool
#> <chr> <chr> <lgl> <lgl> <glue> <chr> <lgl>
#> 1 pool_sqlite A pooled connection to an i… TRUE TRUE RSQLi… NA TRUE
#> 2 simple_sqlite A simple connection to an i… TRUE FALSE RSQLi… NA FALSE
get_default_conn_name()
#> [1] "pool_sqlite"