Save data to the corresponding tables in the SQLite database. Tables includes: price, itinerary, leg, segment, carrier, agent, and place.
dbSaveData(x, conn, ...) # S3 method for list dbSaveData(x, conn, ...) # S3 method for response dbSaveData(x, conn, ...)
x | An object of data to be saved. |
---|---|
conn | A |
... | Further arguments passed to methods. |
list
: Save a list of data.frames in databse.
response
: Save data from the request response in databse.
# 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) # }