r-dbi / dbitest Goto Github PK
View Code? Open in Web Editor NEWTesting DBI drivers
Home Page: http://dbitest.r-dbi.org
License: GNU Lesser General Public License v2.1
Testing DBI drivers
Home Page: http://dbitest.r-dbi.org
License: GNU Lesser General Public License v2.1
Some tests may require configuration:
Via tweaks
argument to make_context()
.
Preference over skip list. For TDD.
Think about data type mapping.
and naming of the test_()
functions.
34: on.exit(expect_error(dbClearResult(res), NA), add = TRUE)
I guess it should be
on.exit(expect_true(dbClearResult(res), NA), add = TRUE)
res <- dbSendQuery(con, sql)
dbBind(res, list(...))
data <- dbFetch(res)
# dbClearResult(res) # no clearing of result here
dbBind(res, list(...))
data <- dbFetch(res)
dbClearResult(res)
Just a reminder to myself.
for the existing backends.
for simplicity.
Outside of test_...() framework -- needs to load and unload the backend package.
Current tests test only one data type at a time. Add tests for using different types at once (only basic types).
if already disconnected/closed.
SQLite only.
Problem: on.exit
appends new handlers, instead of prepending them (which would be better for most use cases). Code like
con <- connect(ctx)
on.exit(dbDisconnect(con), add = TRUE)
res <- dbSendQuery(con, "SELECT 1")
on.exit(dbClearResult(res), add = TRUE)
issues warnings that a connection is closed while result sets are still open. Something like the following might be better:
with_connection({
res <- dbSendQuery(con, "SELECT 1")
on.exit(dbClearResult(res), add = TRUE)
})
Hi Kirill et all,
I am facing issues in test_result that derive form differences among SQL dialects:
dbSendQuery composes a (temporary) table in the DB, thus SELECT 1
becomes CREATE TABLE xy_temp AS (SELECT 1)
. This works for postgres, but e.g. EXASOL and Oracle need a column alias, i.e. SELECT 1 as a
or SELECT 1 as "1"
(quoted identifier needed for the first char is numeric)
Oracle does not get along with SELECT without FROM stmt, it would need e.g. SELECT 1 AS a FROM dual
. EXASOL gets along without, except for in combination with a WHERE clause.
While almost any DBMS should not have problems if col aliases were added, but the dummy table "dual" does not exist everywhere. One option would be to add a parameter to define the table to use. Another would be to have the script create a table in the DBMS before the test and drop it on exit.
My opinion is that that general approach should be to avoid parameters whenever possible (there might be other dialect related issues, adding parameters for everything would cause confusion). Thus I prefer the writing of a table for the test.
Cheers,
Marcel
to cover the SQL -> DB -> SQL -> R path.
as soon as it hits CRAN: https://github.com/metacran/description.
To avoid devtools dependency.
You don’t have admin rights to rstats-db
Related: r-dbi/DBI#18
Tests available in RSQLite.
Linking to vignette.
dbQuoteIdentifier() should not be: r-dbi/DBI#24.
dbQuoteString() should.
See r-dbi/RSQLite#38.
Missing in proposal.
Use on.exit(try(...))
or on.exit(expect_error(...))
.
for stress tests.
Related: #39.
-> NULL
After r-dbi/DBI#42.
where appropriate.
SELECT cast(NULL as <dbDataType()>) AS a
Move/copy testing-related stuff from DBI backend vignette.
after CRAN release of DBI.
for r-dbi/RMySQL#125.
from the skip lists of the existing backends.
Combine with error testing, in particular invalid arguments
Related to NSE.
@jimhester: Do you see a way to make lintr happy with the with_connection
function in this package? Install branch using devtools::install_github("krlmlr/DBItest@feature/result")
. Thanks a lot for your input!
to test doc, as \code{\link[DBI]{db}}
What is the reason for deprecating them?
Example: Invalid connection, invalid result set, ...
Just to be sure.
in DBI project.
all tests are mentioned, missing parts of the DBI are added
Include dbListFields()
Ensure that all lines covered by master are covered after removing the tests.
Trouble opening new R session from R CMD check
. @hadley: What's the best way to do this?
if package is loaded via load_all. Probably no issue for R CMD check.
DBI
is LGPL-2 licensed, probably for a reason. Should we allow using (linking) the package with proprietary code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.