-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathtest_roundtrip.Rd
48 lines (43 loc) · 1.44 KB
/
test_roundtrip.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DataTypes.R
\name{test_roundtrip}
\alias{test_roundtrip}
\title{Test round tripping a simple table}
\usage{
test_roundtrip(
con = DBItest:::connect(DBItest:::get_default_context()),
columns = "",
invert = TRUE,
force_sorted = FALSE
)
}
\arguments{
\item{con}{An established DBI connection.}
\item{columns}{Table columns to exclude (default) or include, dependent on
the value of \code{invert}. One of \code{datetime}, \code{date}, \code{binary},
\code{integer}, \code{double}, \code{character}, \code{logical}.}
\item{invert}{If \code{TRUE}, change the definition of columns to be exclusive,
rather than inclusive.}
\item{force_sorted}{If \code{TRUE}, a sorted \code{id} column is added to the sent
data, and the received data is sorted by this column before doing the
comparison. This is necessary for some databases that do not preserve row
order.}
}
\description{
This tests all the supported data types, including missing values. It first
writes them to the database, then reads them back and verifies the data is
identical to the original.
}
\details{
This function is not exported and should only be used during tests and as a
sanity check when writing new \code{odbcDataType()} methods.
}
\examples{
\dontrun{
test_roundtrip(con)
# exclude a few columns
test_roundtrip(con, c("integer", "double"))
# Only test a specific column
test_roundtrip(con, "integer", invert = FALSE)
}
}