DBItest (version 1.3)

test_result: Test the "Result" class

Description

Test the "Result" class

Usage

test_result(skip = NULL, ctx = get_default_context())

Arguments

skip
[character()] A vector of regular expressions to match against test names; skip test if matching any.
ctx
[DBItest_context] A test context as created by make_context.

Details

This function defines the following tests:
trivial_query
Can issue trivial query, result object inherits from "DBIResult"

clear_result_return
Return value, currently tests that the return value is always TRUE, and that an attempt to close a closed result set issues a warning.

stale_result_warning
Leaving a result open when closing a connection gives a warning

command_query
Can issue a command query that creates a table, inserts a row, and deletes it; the result sets for these query always have "completed" status.

invalid_query
Issuing an invalid query throws error (but no warnings, e.g. related to pending results, are thrown)

fetch_single
single-value queries can be fetched

fetch_multi_row_single_column
multi-row single-column queries can be fetched

fetch_progressive
multi-row queries can be fetched progressively

fetch_more_rows
if more rows than available are fetched, the result is returned in full but no warning is issued

fetch_premature_close
if less rows than available are fetched, the result is returned in full but no warning is issued; also tests the corner case of fetching zero rows

fetch_no_return_value
side-effect-only queries (without return value) can be fetched

fetch_closed
Fetching from a closed result set raises an error

cannot_query_disconnected
Querying a disconnected connection throws error.

get_query_single
single-value queries can be read with dbGetQuery

get_query_multi_row_single_column
multi-row single-column queries can be read with dbGetQuery

get_query_empty_single_column
Empty single-column queries can be read with dbGetQuery. Not all SQL dialects support the query used here.

get_query_single_row_multi_column
single-row multi-column queries can be read with dbGetQuery

get_query_multi
multi-row multi-column queries can be read with dbGetQuery

get_query_empty_multi_column
Empty multi-column queries can be read with dbGetQuery. Not all SQL dialects support the query used here.

data_type_connection
SQL Data types exist for all basic R data types, and the engine can process them.

data_type_factor
SQL data type for factor is the same as for character.

data_integer
data conversion from SQL to R: integer

data_integer_null_below
data conversion from SQL to R: integer with typed NULL values

data_integer_null_above
data conversion from SQL to R: integer with typed NULL values in the first row

data_numeric
data conversion from SQL to R: numeric

data_numeric_null_below
data conversion from SQL to R: numeric with typed NULL values

data_numeric_null_above
data conversion from SQL to R: numeric with typed NULL values in the first row

data_logical
data conversion from SQL to R: logical. Optional, conflict with the data_logical_int test.

data_logical_null_below
data conversion from SQL to R: logical with typed NULL values

data_logical_null_above
data conversion from SQL to R: logical with typed NULL values in the first row

data_logical_int
data conversion from SQL to R: logical (as integers). Optional, conflict with the data_logical test.

data_logical_int_null_below
data conversion from SQL to R: logical (as integers) with typed NULL values

data_logical_int_null_above
data conversion from SQL to R: logical (as integers) with typed NULL values in the first row

data_null
data conversion from SQL to R: A NULL value is returned as NA

data_64_bit
data conversion from SQL to R: 64-bit integers

data_64_bit_null_below
data conversion from SQL to R: 64-bit integers with typed NULL values

data_64_bit_null_above
data conversion from SQL to R: 64-bit integers with typed NULL values in the first row

data_character
data conversion from SQL to R: character

data_character_null_below
data conversion from SQL to R: character with typed NULL values

data_character_null_above
data conversion from SQL to R: character with typed NULL values in the first row

data_raw
data conversion from SQL to R: raw. Not all SQL dialects support the syntax of the query used here.

data_raw_null_below
data conversion from SQL to R: raw with typed NULL values

data_raw_null_above
data conversion from SQL to R: raw with typed NULL values in the first row

data_date
data conversion from SQL to R: date, returned as integer with class

data_date_null_below
data conversion from SQL to R: date with typed NULL values

data_date_null_above
data conversion from SQL to R: date with typed NULL values in the first row

data_time
data conversion from SQL to R: time

data_time_null_below
data conversion from SQL to R: time with typed NULL values

data_time_null_above
data conversion from SQL to R: time with typed NULL values in the first row

data_time_parens
data conversion from SQL to R: time (using alternative syntax with parentheses for specifying time literals)

data_time_parens_null_below
data conversion from SQL to R: time (using alternative syntax with parentheses for specifying time literals) with typed NULL values

data_time_parens_null_above
data conversion from SQL to R: time (using alternative syntax with parentheses for specifying time literals) with typed NULL values in the first row

data_timestamp
data conversion from SQL to R: timestamp

data_timestamp_null_below
data conversion from SQL to R: timestamp with typed NULL values

data_timestamp_null_above
data conversion from SQL to R: timestamp with typed NULL values in the first row

data_timestamp_utc
data conversion from SQL to R: timestamp with time zone

data_timestamp_utc_null_below
data conversion from SQL to R: timestamp with time zone with typed NULL values

data_timestamp_utc_null_above
data conversion from SQL to R: timestamp with time zone with typed NULL values in the first row

data_timestamp_parens
data conversion: timestamp (alternative syntax with parentheses for specifying timestamp literals)

data_timestamp_parens_null_below
data conversion: timestamp (alternative syntax with parentheses for specifying timestamp literals) with typed NULL values

data_timestamp_parens_null_above
data conversion: timestamp (alternative syntax with parentheses for specifying timestamp literals) with typed NULL values in the first row

See Also

Other tests: test_compliance, test_connection, test_driver, test_getting_started, test_meta, test_sql