nycflights13_create_sql function

Create a standardised database for testing

Create a standardised database for testing

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

nycflights13_create_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

Returns

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

Examples

if (check_for_pkg("RSQLite", message)) { con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") nycflights13_create_sql(con) DBI::dbGetQuery( con, "SELECT year, month, day, carrier, flight, tailnum FROM flights LIMIT 10" ) DBI::dbDisconnect(con) }
  • Maintainer: Jonathan Keane
  • License: Apache License (>= 2.0)
  • Last published: 2024-04-09