sn_connect_to_db | R Documentation |
Return a connection to be used for db
sn_connect_to_db(connection = NULL, type = "osm", country = NULL)
connection |
Defaults to NULL. If NULL, uses local SQLite database. If given, must be a connection object (see example) |
country |
Defaults to NULL. |
A connection object.
if (interactive()) {
cache_connection <- DBI::dbConnect(
RSQLite::SQLite(), # or e.g. odbc::odbc(),
Driver = ":memory:", # or e.g. "MariaDB",
Host = "localhost",
database = "example_db",
UID = "example_user",
PWD = "example_pwd"
)
sn_connect_to_db(cache_connection)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.