Capturing and testing

start_db_capturing() start_capturing() stop_db_capturing() stop_capturing()

Capture and record database transactions and save them as mocks

with_mock_db()

Run the DBI queries inside against a mocked db

redact_columns()

Redact columns from a dataframe with the default redactors

.db_mock_paths()

Set an alternate directory for mock API fixtures

driver-specifc-mock-connections

Driver-specific mock classes

Mock DB methods

dbDisconnect(<DBIMockConnection>) dbListTables(<DBIMockConnection>) dbGetInfo(<DBIMockConnection>) dbWriteTable(<DBIMockConnection>,<character>,<data.frame>) dbRemoveTable(<DBIMockConnection>,<character>) dbListTables(<DBIMockConnection>) dbListFields(<DBIMockConnection>,<character>) dbListFields(<DBIMockConnection>,<Id>) dbListFields(<DBIMockConnection>,<ANY>) dbQuoteIdentifier(<DBIMockRPostgresConnection>,<character>) dbQuoteIdentifier(<DBIMockRPostgresConnection>,<SQL>) dbSendQuery(<DBIMockConnection>,<character>) dbFetch(<DBIMockResult>) fetch(<DBIMockResult>,<ANY>) fetch(<DBIMockResult>,<missing>) dbClearResult(<DBIMockResult>) dbHasCompleted(<DBIMockResult>) dbGetQuery(<DBIMockRPostgreSQLConnection>,<character>) dbGetQuery(<DBIMockRPostgreSQLConnection>,<character>) dbColumnInfo(<DBIMockResult>) dbGetInfo(<DBIMockResult>)

Methods for interacting with DB mocks instead of an actual database

with_mock_path()

Run the DBI queries in an alternate mock directory

Test DB creation

nycflights13_sql()

Create a standardised database for testing

nycflights13_sqlite()

Create an in-memory SQLite database for testing