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
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)
})
if already disconnected/closed.
After r-dbi/DBI#42.
to test doc, as \code{\link[DBI]{db}}
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!
if package is loaded via load_all. Probably no issue for R CMD check.
Missing in proposal.
for the existing backends.
You don’t have admin rights to rstats-db
-> NULL
from the skip lists of the existing backends.
Just a reminder to myself.
in DBI project.
all tests are mentioned, missing parts of the DBI are added
Include dbListFields()
Some tests may require configuration:
Via tweaks
argument to make_context()
.
to cover the SQL -> DB -> SQL -> R path.
for r-dbi/RMySQL#125.
Combine with error testing, in particular invalid arguments
Linking to vignette.
Related: r-dbi/DBI#18
where appropriate.
Current tests test only one data type at a time. Add tests for using different types at once (only basic types).
as soon as it hits CRAN: https://github.com/metacran/description.
To avoid devtools dependency.
Think about data type mapping.
Example: Invalid connection, invalid result set, ...
Tests available in RSQLite.
for stress tests.
Related: #39.
for simplicity.
Move/copy testing-related stuff from DBI backend vignette.
SQLite only.
Just to be sure.
Ensure that all lines covered by master are covered after removing the tests.
Use on.exit(try(...))
or on.exit(expect_error(...))
.
dbQuoteIdentifier() should not be: r-dbi/DBI#24.
dbQuoteString() should.
See r-dbi/RSQLite#38.
DBI
is LGPL-2 licensed, probably for a reason. Should we allow using (linking) the package with proprietary code?
after CRAN release of DBI.
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)
Outside of test_...() framework -- needs to load and unload the backend package.
What is the reason for deprecating them?
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
SELECT cast(NULL as <dbDataType()>) AS a
Trouble opening new R session from R CMD check
. @hadley: What's the best way to do this?
Preference over skip list. For TDD.
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.