Skip to content

Commit

Permalink
Merge branch 'release/0.4-1' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Müller committed May 8, 2016
2 parents 7945c39 + 611bb71 commit 021e0a2
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 24 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: DBI
Version: 0.4
Date: 2016-04-30
Version: 0.4-1
Date: 2016-05-07
Title: R Database Interface
Description: A database interface definition for communication
between R and relational database management systems. All
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# DBI 0.4-1 (2016-05-07)

- The default `show()` implementations silently ignore all errors. Some DBI drivers (e.g., RPostgreSQL) might fail to implement `dbIsValid()` or the other methods used.


# DBI 0.4 (2016-04-30)

* New package maintainer: Kirill Müller.
Expand Down
11 changes: 10 additions & 1 deletion R/DBConnection.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ setClass("DBIConnection", representation("DBIObject", "VIRTUAL"))
#' @rdname DBIConnection-class
#' @export
setMethod("show", "DBIConnection", function(object) {
# to protect drivers that fail to implement the required methods (e.g.,
# RPostgreSQL)
tryCatch(
show_connection(object),
error = function(e) NULL)
invisible(NULL)
})

show_connection <- function(object) {
cat("<", is(object)[1], ">\n", sep = "")
if (!dbIsValid(object)) {
cat(" DISCONNECTED\n")
}
})
}

#' Disconnect (close) a connection
#'
Expand Down
11 changes: 10 additions & 1 deletion R/DBDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,18 @@ setMethod("dbDriver", "character",
#' @rdname DBIDriver-class
#' @export
setMethod("show", "DBIDriver", function(object) {
cat("<", is(object)[1], ">\n", sep = "")
tryCatch(
# to protect drivers that fail to implement the required methods (e.g.,
# RPostgreSQL)
show_driver(object),
error = function(e) NULL)
invisible(NULL)
})

show_driver <- function(object) {
cat("<", is(object)[1], ">\n", sep = "")
}

findDriver <- function(drvName) {
# If it exists in the global environment, use that
d <- get2(drvName, globalenv())
Expand Down
16 changes: 12 additions & 4 deletions R/DBResult.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ setClass("DBIResult", representation("DBIObject", "VIRTUAL"))
#' @rdname DBIResult-class
#' @export
setMethod("show", "DBIResult", function(object) {
# to protect drivers that fail to implement the required methods (e.g.,
# RPostgreSQL)
tryCatch(
show_result(object),
error = function(e) NULL)
invisible(NULL)
})

show_result <- function(object) {
cat("<", is(object)[1], ">\n", sep = "")
if(!dbIsValid(object)){
cat("EXPIRED\n")
Expand All @@ -34,8 +43,7 @@ setMethod("show", "DBIResult", function(object) {
cat(" ROWS Fetched: ", dbGetRowCount(object), " [", done, "]\n", sep = "")
cat(" Changed: ", dbGetRowsAffected(object), "\n", sep = "")
}
invisible(NULL)
})
}

#' Fetch records from a previously executed query.
#'
Expand Down Expand Up @@ -148,7 +156,7 @@ setGeneric("dbGetStatement",


#' Completion status
#'
#'
#' This method returns if the operation has completed.
#'
#' @inheritParams dbClearResult
Expand Down Expand Up @@ -179,7 +187,7 @@ setGeneric("dbGetRowsAffected",


#' The number of rows fetched so far
#'
#'
#' This value is increased by calls to \code{\link{dbFetch}}. For a data
#' modifying query, the return value is 0.
#'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DBI

[![Build Status](https://travis-ci.org/rstats-db/DBI.png?branch=master)](https://travis-ci.org/rstats-db/DBI) [![Coverage Status](https://img.shields.io/codecov/c/github/rstats-db/DBI/master.svg)](https://codecov.io/github/rstats-db/DBI?branch=master)
[![Build Status](https://travis-ci.org/rstats-db/DBI.png?branch=master)](https://travis-ci.org/rstats-db/DBI) [![Coverage Status](https://img.shields.io/codecov/c/github/rstats-db/DBI/master.svg)](https://codecov.io/github/rstats-db/DBI?branch=master) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/DBI)](https://cran.r-project.org/package=DBI)

The DBI package defines a common interface between the R and database management systems (DBMS). The interface defines a small set of classes and methods similar in spirit to Perl's [DBI](http://dbi.perl.org/), Java's [JDBC](http://www.oracle.com/technetwork/java/javase/jdbc/index.html), Python's [DB-API](http://www.python.org/dev/peps/pep-0249/), and Microsoft's [ODBC](http://en.wikipedia.org/wiki/ODBC). It defines a set of classes and methods defines what operations are possible and how they are performed:

Expand Down
24 changes: 9 additions & 15 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
Follow-up release because R CMD check now fails for RPostgreSQL. An update to RMySQL will be released to address the regressions in that package.

## Test environments
* ubuntu 15.10 (local install), R 3.2.5
* ubuntu 12.04 (on travis-ci), R 3.2.5
* win-builder (devel)
* ubuntu 15.10 (local install), R 3.3.0
* ubuntu 12.04 (on travis-ci), R devel, release, and oldrel
* win-builder (release and devel)


## R CMD check results

0 errors | 0 warnings | 2 notes

New maintainer:
Kirill Müller <[email protected]>
Old maintainer(s):
Hadley Wickham <[email protected]>

5 days since last update

Found the following apparent S3 methods exported but not registered:
print.list.pairs

- Hadley agrees that I act as maintainer: https://github.com/rstats-db/DBI/commit/278f233c15ea629db8cc9ccd156d236d0a815cdd#commitcomment-16886895
- Bugfix release to fix regression in RPostgreSQL

- print.list.pairs() has been deprecated and will be removed soon.


## Reverse dependencies

* I have run R CMD check on the 61 downstream dependencies.
(Summary at https://github.com/rstats-db/DBI/tree/0066ef1d03afc0c0caaf2436fa898755a2dba89f/revdep).

* There were failures and packages I could not install. For those packages that I could install, the DBI changes only seemed to trigger a regression in RMySQL, which will be investigated.

* All revdep maintainers were notified of the release on 2016-03-30.
* I have run R CMD check on RPostgreSQL with `Sys.setenv("POSTGRES_USER" = "muelleki", "POSTGRES_HOST" = "/run/postgresql", "POSTGRES_DATABASE" = "muelleki")` to run the tests against a database, this now succeeds. The difference to the released version 0.4 is minor and should not affect other packages.

0 comments on commit 021e0a2

Please sign in to comment.