Git Product home page Git Product logo

dbitest's People

Contributors

aviator-app[bot] avatar dpprdan avatar hoesler avatar imanuelcostigan avatar indrajeetpatil avatar jimhester avatar jonmcalder avatar krlmlr avatar michaelchirico avatar michaelquinn32 avatar thrasibule avatar tschiefer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dbitest's Issues

Test return values and error conditions

  • dbBind(): input result (invisibly)
  • dbClearResult(): TRUE
  • dbColumnInfo(): a data frame with three columns (r-dbi/DBI#78)
  • dbConnect()
  • dbDataType()
  • dbDisconnect(): TRUE
  • dbExistsTable(): logical
    • scalar input
  • dbFetch(): a data frame
    • scalar input
  • dbGetInfo(): a named list
  • dbExecute()
    • scalar input
  • dbGetQuery()
    • scalar input
  • dbGetRowCount(): an integer
  • dbGetRowsAffected(): an integer
  • dbGetStatement(): a character
  • dbHasCompleted(): TRUE
  • dbIsValid(): TRUE
  • dbListTables(): a character vector
  • dbListFields()
    • scalar input
  • dbQuoteIdentifier(): a classed object (of class "SQL")
  • dbQuoteString(): a classed object (of class "SQL")
  • dbReadTable(): a data frame
    • scalar input
  • dbRemoveTable(): TRUE
    • scalar input
  • dbSendQuery()
    • scalar input
  • dbSendStatement()
    • scalar input
  • dbWriteTable(): TRUE
    • scalar input

Combine with error testing, in particular invalid arguments

Think about licensing

DBI is LGPL-2 licensed, probably for a reason. Should we allow using (linking) the package with proprietary code?

Configuration

Some tests may require configuration:

  • Name of driver constructor
  • Kind of dbBind() placeholder
  • DUAL table (#47)

Via tweaks argument to make_context().

lintr errors for with_connection

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!

Create vignette

Move/copy testing-related stuff from DBI backend vignette.

Add test for repeated dbBind()

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)

Update DBI vignette

in DBI project.

all tests are mentioned, missing parts of the DBI are added

Include dbListFields()

with_connection()

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)
      })

different SQL dialects among DBMS: in test_result: column alias & FROM stmt.)

Hi Kirill et all,

I am facing issues in test_result that derive form differences among SQL dialects:

a. column alias:

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)

b. FROM statement:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.