Methods for interacting with DB mocks instead of an actual database
Source:R/connection.R
, R/dbExistsTable.R
, R/dbListTables-Fields.R
, and 4 more
mock-db-methods.Rd
Various methods (dbSendQuery
, dbFetchQuery
) that are mocks of the
DBI methods of the same name.
Instead of actually interacting with a database, they read in mock responses
and the code proceeds after that. These aren't used directly, but are part of
how dittodb
works.
Usage
# S4 method for DBIMockConnection
dbDisconnect(conn, ...)
dbMockConnect(drv, ...)
# S4 method for DBIMockConnection,character
dbExistsTable(conn, name, ...)
# S4 method for DBIMockConnection,Id
dbExistsTable(conn, name, ...)
# S4 method for DBIMockConnection
dbListTables(conn, ...)
# S4 method for DBIMockConnection,character
dbListFields(conn, name, ...)
# S4 method for DBIMockConnection,Id
dbListFields(conn, name, ...)
# S4 method for DBIMockConnection,ANY
dbListFields(conn, name, ...)
# S4 method for DBIMockConnection,character
dbSendQuery(conn, statement, ...)
# S4 method for DBIMockConnection,SQL
dbSendQuery(conn, statement, ...)
# S4 method for DBIMockConnection,character
dbSendStatement(conn, statement, ...)
# S4 method for DBIMockResult
dbFetch(res, n = -1, ...)
# S4 method for DBIMockResult,ANY
fetch(res, n = -1, ...)
# S4 method for DBIMockResult,missing
fetch(res, n = -1, ...)
# S4 method for DBIMockResult
dbClearResult(res, n, ...)
# S4 method for DBIMockResult
dbHasCompleted(res, ...)
# S4 method for DBIMockRPostgreSQLConnection,character
dbGetQuery(conn, statement, ...)
# S4 method for DBIMockResult
dbGetRowsAffected(res, ...)
# S4 method for DBIMockConnection
dbGetInfo(dbObj, ...)
# S4 method for DBIMockConnection,character,data.frame
dbWriteTable(conn, name, value, ...)
# S4 method for DBIMockConnection,character
dbRemoveTable(conn, name, ...)
# S4 method for DBIMockResult
dbColumnInfo(res, ...)
# S4 method for DBIMockResult
dbGetInfo(dbObj, ...)
# S4 method for DBIMockRPostgresConnection,character
dbQuoteIdentifier(conn, x, ...)
# S4 method for DBIMockRPostgresConnection,SQL
dbQuoteIdentifier(conn, x, ...)
# S4 method for DBIMockRPostgresConnection,character
dbQuoteString(conn, x, ...)
# S4 method for DBIMockRPostgresConnection,SQL
dbQuoteString(conn, x, ...)
# S4 method for DBIMockMariaDBConnection,character
dbQuoteString(conn, x, ...)
# S4 method for DBIMockMariaDBConnection,SQL
dbQuoteString(conn, x, ...)
# S4 method for DBIMockConnection
dbBegin(conn, ..., name = NULL)
# S4 method for DBIMockConnection
dbCommit(conn, ..., name = NULL)
# S4 method for DBIMockConnection
dbRollback(conn, ..., name = NULL)
Arguments
- conn
a database connection (for dispatch with these methods, it should be of class
DBIMockConnection
)- ...
arguments passed on inside of the methods
- drv
a DB driver for use in
dbConnect
- name
name of the table (for
dbListFields
,dbWriteTable
,dbRemoveTable
)- statement
an SQL statement to execute
- res
a result object (for dispatch with these methods, it should be of class
DBIMockResult
)- n
number of results to fetch (ignored)
- dbObj
a database object (a connection, result, etc.) for use in
dbGetInfo
- value
a value (generally a
data.frame
) for use indbWriteTable
- x
a name to quote (for
dbQuoteIdentifier
)