Skip to contents

Mock DB methods

with_mock_db() start_mock_db() stop_mock_db()
Run DBI queries against a mocked database
with_mock_path()
Run the DBI queries in an alternate mock directory

Capturing fixtures

start_db_capturing() stop_db_capturing() capture_db_requests()
Capture and record database transactions and save them as mocks

Utilities

expect_sql() experimental
Detect if a specific SQL statement is sent
db_mock_paths() .db_mock_paths()
Set an alternate directory for mock API fixtures
redact_columns()
Redact columns from a dataframe with the default redactors
set_dittodb_debug_level()
Set dittodb's debug level
use_dittodb()
Use dittodb in your tests

DBI methods

Test DB creation

nycflights_sqlite()
An SQLite connection to a subset of nycflights13
nycflights13_create_sql()
Create a standardised database for testing
nycflights13_create_sqlite()
Create an in-memory SQLite database for testing