Learn R Programming

DBItest

This package is primarily useful for developers of DBI backends. It provides a considerable set of test cases for DBI backends. These test cases correspond to the DBI specification. Please follow the steps below to add these test cases to your DBI backend.

Installation

Install from CRAN via

install.packages("DBItest")

or the development version using

devtools::install_github("r-dbi/DBItest")

Usage

In your driver package, add DBItest to the Suggests: and enable the tests. Run the following code in you package's directory:

# install.packages("usethis")
usethis::use_package("DBItest", "suggests")
usethis::use_test("DBItest")

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 default_skip argument to make_context() allows skipping tests that are not (yet) satisfied by your backend.

Further reading:

  • Detailed instructions in vignette("DBItest")

  • The feature list in the original proposal.


Please note that the 'DBItest' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('DBItest')

Monthly Downloads

6,841

Version

1.8.2

License

LGPL (>= 2.1)

Issues

Pull Requests

Stars

Forks

Maintainer

Kirill M<c3><bc>ller

Last Published

December 7th, 2024

Functions in DBItest (1.8.2)

spec_result_create_table_with_data_type

spec_result_create_table_with_data_type
spec_driver_connect

spec_driver_connect
spec_meta_get_statement

spec_meta_get_statement
spec_meta_has_completed

spec_meta_has_completed
spec_result_get_query

spec_result_get_query
spec_result_fetch

spec_result_fetch
spec_sql_exists_table

spec_sql_exists_table
spec_result_send_statement

spec_result_send_statement
spec_result_clear_result

spec_result_clear_result
spec_sql_create_table

spec_sql_create_table
spec_sql_append_table

spec_sql_append_table
spec_meta_is_valid

spec_meta_is_valid
spec_meta_get_row_count

spec_meta_get_row_count
spec_sql_list_fields

spec_sql_list_fields
spec_meta_get_rows_affected

spec_meta_get_rows_affected
spec_sql_list_objects

spec_sql_list_objects
spec_result_roundtrip

spec_result_roundtrip
spec_transaction_begin_commit_rollback

spec_transaction_begin_commit_rollback
spec_result_send_query

spec_result_send_query
spec_result_execute

spec_result_execute
spec_sql_write_table

spec_sql_write_table
spec_sql_unquote_identifier

spec_sql_unquote_identifier
spec_transaction_with_transaction

spec_transaction_with_transaction
spec_sql_quote_literal

spec_sql_quote_literal
spec_sql_quote_string

spec_sql_quote_string
spec_sql_read_table

spec_sql_read_table
test_connection

Test the "Connection" class
tweaks

Tweaks for DBI tests
test_compliance

Test full compliance to DBI
spec_sql_remove_table

spec_sql_remove_table
test_sql

Test SQL methods
test_result

Test the "Result" class
test_transaction

Test transaction functions
test_stress

Stress tests
spec_sql_list_tables

spec_sql_list_tables
test_all

Run all tests
spec_sql_quote_identifier

spec_sql_quote_identifier
test_getting_started

Getting started with testing
test_meta

Test metadata functions
test_data_type

test_data_type
test_driver

Test the "Driver" class
test_arrow

Test Arrow methods
spec_arrow_fetch_arrow_chunk

spec_arrow_fetch_arrow_chunk
spec_arrow_append_table_arrow

spec_arrow_append_table_arrow
make_placeholder_fun

Create a function that creates n placeholders
spec_arrow_get_query_arrow

spec_arrow_get_query_arrow
make_context

Test contexts
spec_arrow_create_table_arrow

spec_arrow_create_table_arrow
spec_arrow_send_query_arrow

spec_result_send_query
DBItest-package

DBItest: Testing DBI Backends
spec_arrow_read_table_arrow

spec_arrow_read_table_arrow
spec_arrow_fetch_arrow

spec_arrow_fetch_arrow
spec_connection_disconnect

spec_connection_disconnect
spec_driver_constructor

spec_driver_constructor
spec_meta_bind

spec_meta_bind
spec_arrow_write_table_arrow

spec_arrow_write_table_arrow
spec_compliance_methods

spec_compliance_methods
spec_meta_column_info

spec_meta_column_info
spec_get_info

spec_driver_get_info
spec_driver_data_type

spec_driver_data_type
spec_getting_started

spec_getting_started