rocker-S3-functions {rocker}R Documentation

'rocker' Database Interface R6 Class - S3 functions

Description

R6 class interface for handling database connections using DBI package as backend. The class allows handling of connections to e.g. PostgreSQL, MariaDB and SQLite. Although rocker is a R6 class, functions can be also accesses in classical S3 way.

See Also

Other rocker-S3-functions: appendTable(), begin(), canConnect(), clearResult(), columnInfo(), commit(), connect(), createTable(), disconnect(), execute(), existsTable(), fetch(), getInfoCon(), getInfoDrv(), getInfoRes(), getQuery(), getRowCount(), getRowsAffected(), getStatement(), hasCompleted(), isValidCon(), isValidDrv(), isValidRes(), listFields(), listObjects(), listTables(), readTable(), removeTable(), rocker-README, rocker-package, rollback(), sendQuery(), sendStatement(), setupDriver(), setupMariaDB(), setupPostgreSQL(), setupSQLite(), unloadDriver(), validateCon(), writeTable()

Other rocker: newDB(), rocker-R6-class, rocker-README, rocker-package

Examples

# New database handling object
db <- rocker::newDB()
# Setup SQLite database
rocker::setupSQLite(db)
# Open connection
rocker::connect(db)
# Write table
rocker::writeTable(db, "mtcars", mtcars)
# Get query
output <- rocker::getQuery(db, "SELECT * FROM mtcars;")
# Close connection
rocker::disconnect(db)
# Reset database handling object
rocker::unloadDriver(db)

[Package rocker version 0.3.1 Index]