Description Usage Arguments Value Examples
View source: R/nycflights13_sql.R
Using the connection given in con
, create a database including a few tables
from the nycflights13 dataset.
1 | nycflights13_sql(con, schema = "", ...)
|
con |
an SQL connection (i.e a PostgreSQL connection) |
schema |
schema to write the tables ("", or no schema by default) |
... |
additional parameters to connect to a database |
the connection given in con
invisibly, generally called for the side effects
of writing to the database
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ## Not run:
connections <- list(
odbc = DBI::dbConnect(
odbc::odbc(),
Driver = "PostgreSQL Unicode",
Server = "127.0.0.1",
Database = "postgres",
UID = "travis",
PWD = "",
Port = 5432
),
rpostgresql = RPostgreSQL::dbConnect(
drv = DBI::dbDriver("PostgreSQL"),
host = "127.0.0.1",
dbname = "postgres",
user = "travis",
password = "",
port = 5432
),
rpostgres = DBI::dbConnect(
drv = RPostgres::Postgres(),
host = "127.0.0.1",
dbname = "postgres",
user = "travis",
password = "",
port = 5432
)
)
nycflights13_sql(connections$odbc, schema = "nycflights13")
# same as
# nycflights13_sql(connections$rpostgresql, schema = "nycflights13")
# also same as
# nycflights13_sql(connections$rpostgres, schema = "nycflights13")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.