View source: R/datasets_to_sqlite.R
datasets_to_sql | R Documentation |
SQL databases are the cornerstone of many data science efforts.
We provide this simple function to export all the available
datasets in available_datasets()
to any relational database
supported by dbplyr.
datasets_to_sql( con, dataset_accessors = available_datasets()$accessor, overwrite = TRUE, ... )
con |
a remote data source. See |
dataset_accessors |
character() vector of accessors for datasets.
The |
overwrite |
If TRUE, will overwrite an existing table with name name. If FALSE, will throw an error if name already exists. |
... |
passed on to |
Create connections using RSQLite::SQLite() for RSQLite, RMariaDB::MariaDB() for RMariaDB, RPostgres::Postgres() for RPostgres, odbc::odbc() for odbc, and bigrquery::bigquery() for BigQuery.
used for side effects
Sean Davis seandavi@gmail.com
dplyr::copy_to()
if(requireNamespace("RSQLite", quietly=TRUE) & requireNamespace("DBI", quietly=TRUE)) { sql = DBI::dbConnect(RSQLite::SQLite(), ':memory:') datasets_to_sql(sql, dataset_accessors = "coronadatascraper_data") DBI::dbListTables(sql) DBI::dbDisconnect(sql) } else { print("install.packages('RSQLite') to run this example") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.