Skip to content

Commit

Permalink
Merge pull request #190 from anhqle/add-generic-dbIsReadOnly
Browse files Browse the repository at this point in the history
- Add new generic `dbIsReadOnly()` (#190, @anhqle).
  • Loading branch information
krlmlr authored Mar 26, 2018
2 parents 0b0e21a + e550db6 commit 5e394a6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/DBObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ setGeneric("dbIsValid",
valueClass = "logical"
)

#' Is this DBMS object read only?
#'
#' This generic tests whether a database object is read only.
#'
#' @inheritParams dbGetInfo
#' @family DBIDriver generics
#' @family DBIConnection generics
#' @family DBIResult generics
#' @export
#' @examples
#' dbIsReadOnly(RSQLite::SQLite())
#'
#' con <- dbConnect(RSQLite::SQLite(), ":memory:", flags = SQLITE_RO)
#' dbIsReadOnly(con)
setGeneric("dbIsReadOnly",
def = function(dbObj, ...) standardGeneric("dbIsReadOnly"),
valueClass = "logical")

setGeneric("summary")
setMethod("summary", "DBIObject", function(object, ...) {
info <- dbGetInfo(dbObj = object, ...)
Expand Down

0 comments on commit 5e394a6

Please sign in to comment.