get_connection | R Documentation |
This is a convenience wrapper for DBI::dbConnect() for different database backends.
Connects to the specified dbname of host:port using user and password from given arguments (if applicable). Certain drivers may use credentials stored in a file, such as ~/.pgpass (PostgreSQL).
get_connection(drv, ...)
## S3 method for class 'SQLiteDriver'
get_connection(
drv,
dbname = ":memory:",
...,
bigint = c("integer", "bigint64", "numeric", "character")
)
## S3 method for class 'PqDriver'
get_connection(
drv,
dbname = NULL,
host = NULL,
port = NULL,
password = NULL,
user = NULL,
...,
bigint = c("integer", "bigint64", "numeric", "character"),
check_interrupts = TRUE,
timezone = Sys.timezone(),
timezone_out = Sys.timezone()
)
## S3 method for class 'OdbcDriver'
get_connection(
drv,
dsn = NULL,
...,
bigint = c("integer", "bigint64", "numeric", "character"),
timezone = Sys.timezone(),
timezone_out = Sys.timezone()
)
## S3 method for class 'duckdb_driver'
get_connection(
drv,
dbdir = ":memory:",
...,
bigint = c("numeric", "character"),
timezone_out = Sys.timezone()
)
## Default S3 method:
get_connection(drv, ...)
drv |
( |
... |
Additional parameters sent to DBI::dbConnect(). |
dbname |
( |
bigint |
( |
host |
( |
port |
( |
password |
( |
user |
( |
check_interrupts |
( |
timezone |
( |
timezone_out |
( |
dsn |
( |
dbdir |
( |
An object that inherits from DBIConnection
driver specified in drv
.
RSQLite::SQLite
RPostgres::Postgres
odbc::odbc
duckdb::duckdb
conn <- get_connection(drv = RSQLite::SQLite(), dbname = ":memory:")
DBI::dbIsValid(conn) # TRUE
close_connection(conn)
DBI::dbIsValid(conn) # FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.