dbCreateDB: Connect to a SQLite database and create tables.

Description Usage Arguments Value Examples

Description

Connect to a SQLite database file. And check it the following tables exists: price, itinerary, leg, segment, carrier, agent, and place. If not, create them.

Usage

1
dbCreateDB(conn = RSQLite::SQLite(), dbname = "flight.db")

Arguments

conn

A SQLiteDriver or SQLiteConnection.

dbname

The path to the database file. Don't use two exceptions:

  • "" will create a temporary on-disk database. The file will be deleted when the connection is closed.

  • ":memory:" or "file::memory:" will create a temporary in-memory database.

Value

An object of class SQLiteConnection. If can't connect to SQLite driver, return 1.

Examples

1
2
con <- dbCreateDB(dbname = ":memory:")
dbDisconnect(con)

MinZhang95/flightscanner documentation built on July 1, 2019, 9:36 p.m.