Learn R Programming

⚠️There's a newer version (1.8.2) of this package.Take me there.

DBItest

This package provides a considerable set of test cases which you can easily incorporate in your DBI driver package.

Usage

Install from CRAN via

install.packages("DBItest")

or the development version using

devtools::install_github("rstats-db/DBItest")

In your driver backage, add DBItest to the Suggests:. Then, enable the tests by running

devtools::use_testthat()
devtools::use_test("DBItest")

from your package's directory. This enables testing using testthat (if necessary) and creates, among others, a file test-DBItest.R in the tests/testthat directory. Replace its entire contents by the following:

DBItest::make_context(Kazam(), NULL)
DBItest::test_all()

(This assumes that Kazam() returns an instance of your DBIDriver class. Additional arguments to dbConnect() are specified as named list instead of the NULL argument to make_context().)

The skip argument to test_all() allows specifying skipped tests.

See the package's documentation and the feature list for a description of the tests.

Copy Link

Version

Install

install.packages('DBItest')

Monthly Downloads

5,864

Version

1.5-2

License

LGPL (>= 2)

Maintainer

Kirill Müller

Last Published

January 25th, 2018

Functions in DBItest (1.5-2)

make_placeholder_fun

Create a function that creates n placeholders
spec_connection_disconnect

spec_connection_disconnect
DBIspec-wip

DBI specification (work in progress)
DBIspec

DBI specification
spec_result_execute

spec_result_execute
spec_result_fetch

spec_result_fetch
DBItest-package

DBItest: Testing 'DBI' Back Ends
make_context

Test contexts
spec_result_clear_result

spec_result_clear_result
spec_result_create_table_with_data_type

spec_result_create_table_with_data_type
spec_result_send_query

spec_result_send_query
spec_result_send_statement

spec_result_send_statement
spec_meta_has_completed

spec_meta_has_completed
spec_meta_is_valid

spec_meta_is_valid
spec_sql_quote_identifier

spec_sql_quote_identifier
spec_sql_quote_string

spec_sql_quote_string
spec_meta_bind

spec_meta_bind
spec_meta_get_row_count

spec_meta_get_row_count
spec_result_get_query

spec_result_get_query
spec_result_roundtrip

spec_result_roundtrip
spec_sql_write_table

spec_sql_write_table
spec_sql_exists_table

spec_sql_exists_table
spec_sql_list_tables

spec_sql_list_tables
spec_driver_connect

spec_driver_connect
spec_driver_data_type

spec_driver_data_type
spec_meta_get_rows_affected

spec_meta_get_rows_affected
spec_meta_get_statement

spec_meta_get_statement
spec_sql_read_table

spec_sql_read_table
spec_sql_remove_table

spec_sql_remove_table
test_getting_started

Getting started with testing
test_meta

Test metadata functions
spec_transaction_begin_commit_rollback

spec_transaction_begin_commit_rollback
test_compliance

Test full compliance to DBI
test_connection

Test the "Connection" class
test_stress

Stress tests
test_transaction

Test transaction functions
test_data_type

test_data_type
test_driver

Test the "Driver" class
tweaks

Tweaks for DBI tests
test_result

Test the "Result" class
test_sql

Test SQL methods
spec_transaction_with_transaction

spec_transaction_with_transaction
test_all

Run all tests