jbryer / sqlutils

Utilies for managing libraries of SQL queries.
23 stars 5 forks source link

Switch to modern DBI usage #7

Open hadley opened 9 years ago

hadley commented 9 years ago

i.e.

require(DBI)
sqlfile <- paste(system.file(package='sqlutils'), '/db/students.db', sep='')
m <- dbDriver(RSQLite::SQLite())
conn <- dbConnect(m, dbname=sqlfile)
q1 <- execQuery('StudentSummary', connection=conn)
hadley commented 9 years ago

Similarly

sqlexec.SQLiteConnection <- function(connection, sql, ...) {
  DBI::dbGetQuery(connection, sql, ...)
}