Using the connection given in con, create a database including a few tables from the nycflights13 dataset.

nycflights13_sql(con, schema = "", ...)

Arguments

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

Value

the connection given in con invisibly, generally called for the side effects of writing to the database

Examples

if (FALSE) { 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") }