dbSaveData: Save data to SQLite database.

Description Usage Arguments Methods (by class) Examples

Description

Save data to the corresponding tables in the SQLite database. Tables includes: price, itinerary, leg, segment, carrier, agent, and place.

Usage

1
2
3
4
5
6
7
dbSaveData(x, conn, ...)

## S3 method for class 'list'
dbSaveData(x, conn, ...)

## S3 method for class 'response'
dbSaveData(x, conn, ...)

Arguments

x

An object of data to be saved.

conn

A SQLiteConnection object, as returned by dbConnect().

...

Further arguments passed to methods.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Get data from API
apiSetKey("YOUR_API_KEY")
resp <- apiCreateSession(origin = "SFO", destination = "LHR", startDate = "2019-07-01")
resp <- apiPollSession(resp)
data <- flightGet(resp)

# Connect to SQLite database
con <- dbCreateDB(dbname = ":memory:")
dbSaveData(resp, con)  # from response
dbSaveData(data, con)  # from list
dbDisconnect(con)

## End(Not run)

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