Package: dittodb 0.1.11.9000

Jonathan Keane

dittodb: A Test Environment for Database Requests

Testing and documenting code that communicates with remote databases can be painful. Although the interaction with R is usually relatively simple (e.g. data(frames) passed to and from a database), because they rely on a separate service and the data there, testing them can be difficult to set up, unsustainable in a continuous integration environment, or impossible without replicating an entire production cluster. This package addresses that by allowing you to make recordings from your database interactions and then play them back while testing (or in other contexts) all without needing to spin up or have access to the database your code would typically connect to.

Authors:Jonathan Keane [aut, cre], Mauricio Vargas [aut], Helen Miller [rev], Etienne Racine [rev]

dittodb_0.1.11.9000.tar.gz
dittodb_0.1.11.9000.zip(r-4.6)dittodb_0.1.11.9000.zip(r-4.5)dittodb_0.1.11.9000.zip(r-4.4)
dittodb_0.1.11.9000.tgz(r-4.6-any)dittodb_0.1.11.9000.tgz(r-4.5-any)
dittodb_0.1.11.9000.tar.gz(r-4.6-any)dittodb_0.1.11.9000.tar.gz(r-4.5-any)
dittodb_0.1.11.9000.tgz(r-4.5-emscripten)
dittodb.pdf |dittodb.html
dittodb/json (API)
NEWS

# Install 'dittodb' in R:
install.packages('dittodb', repos = c('https://packages.ropensci.org', 'https://cloud.r-project.org'))

Reviews:rOpenSci Software Review #366

Bug tracker:https://github.com/ropensci/dittodb/issues

Pkgdown/docs site:https://dittodb.jonkeane.com

On CRAN:

Conda:

8.36 score 83 stars 57 scripts 754 downloads 52 exports 6 dependencies

Last updated from:a9bcdfe0ab (on main). Checks:10 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK332
pkgdown docsOK200
source / vignettesOK380
linux-release-x86_64OK275
macos-devel-arm64OK203
macos-release-arm64OK125
windows-develOK123
windows-releaseOK183
windows-oldrelOK197
wasm-releaseOK305

Exports:.db_mock_paths.dittodb_envcapture_db_requestscheck_db_pathcheck_for_pkgclean_statementdb_mock_pathsdb_path_sanitizedbBegindbClearResultdbColumnInfodbCommitdbDisconnectdbExistsTabledbFetchdbGetInfodbGetQuerydbGetRowsAffecteddbHasCompleteddbListFieldsdbListTablesdbMockConnectdbQuoteIdentifierdbQuoteStringdbRemoveTabledbRollbackdbSendQuerydbSendStatementdbWriteTabledittodb_debug_levelexpect_sqlfetchget_dbnameget_redactorget_typehashhash_db_objectmake_pathnycflights_sqlitenycflights13_create_sqlnycflights13_create_sqliteredact_columnssanitize_table_idserialize_bit64set_dittodb_debug_levelstart_db_capturingstart_mock_dbstop_db_capturingstop_mock_dbuse_dittodbwith_mock_dbwith_mock_path

Dependencies:cliDBIdigestgluelifecyclerlang

Developing dittodb

Rendered fromdeveloping-dittodb.Rmdusingknitr::rmarkdownon Feb 24 2026.

Last update: 2026-01-11
Started: 2020-05-03

Getting Started with dittodb

Rendered fromdittodb.Rmdusingknitr::rmarkdownon Feb 24 2026.

Last update: 2025-08-17
Started: 2020-04-24

nycflights13 data

Rendered fromnycflights.Rmdusingknitr::rmarkdownon Feb 24 2026.

Last update: 2024-04-09
Started: 2020-01-14

Readme and manuals

Help Manual

Help pageTopics
Capture and record database transactions and save them as mockscapture_db_requests capture_requests start_db_capturing stop_db_capturing
Detect if a specific SQL statement is sentexpect_sql
Methods for interacting with DB mocks instead of an actual databasedbBegin,DBIMockConnection-method dbClearResult,DBIMockResult-method dbColumnInfo,DBIMockResult-method dbCommit,DBIMockConnection-method dbDisconnect,DBIMockConnection-method dbExistsTable,DBIMockConnection,character-method dbExistsTable,DBIMockConnection,Id-method dbFetch,DBIMockResult-method dbGetInfo,DBIMockConnection-method dbGetInfo,DBIMockResult-method dbGetQuery,DBIMockRPostgreSQLConnection,character-method dbGetRowsAffected,DBIMockResult-method dbHasCompleted,DBIMockResult-method DBIMockConnection-class DBIMockResult-class dbListFields,DBIMockConnection,ANY-method dbListFields,DBIMockConnection,character-method dbListFields,DBIMockConnection,Id-method dbListTables,DBIMockConnection-method dbMockConnect dbQuoteIdentifier,DBIMockRPostgresConnection,character-method dbQuoteIdentifier,DBIMockRPostgresConnection,SQL-method dbQuoteString,DBIMockMariaDBConnection,character-method dbQuoteString,DBIMockMariaDBConnection,SQL-method dbQuoteString,DBIMockRPostgresConnection,character-method dbQuoteString,DBIMockRPostgresConnection,SQL-method dbRemoveTable,DBIMockConnection,character-method dbRollback,DBIMockConnection-method dbSendQuery,DBIMockConnection,character-method dbSendQuery,DBIMockConnection,SQL-method dbSendStatement,DBIMockConnection,character-method dbWriteTable,DBIMockConnection,character,data.frame-method fetch,DBIMockResult,ANY-method fetch,DBIMockResult,missing-method fetch,DBIMockResult-method mock-db-methods
Run DBI queries against a mocked databasemockdb start_mock_db stop_mock_db with_mock_db
An SQLite connection to a subset of nycflights13nycflights_sqlite
Create a standardised database for testingnycflights13_create_sql
Create an in-memory SQLite database for testingnycflights13_create_sqlite
Redact columns from a dataframe with the default redactorsredact_columns
Set 'dittodb''s debug levelset_dittodb_debug_level
Use 'dittodb' in your testsuse_dittodb
Run the DBI queries in an alternate mock directorywith_mock_path