Skip to content

Commit b18a6d1

Browse files
committed
Merge branch 'r-0.7-12' into production
2 parents 5bc43bb + 3ef8994 commit b18a6d1

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: DBI
2-
Version: 0.7-11
3-
Date: 2017-08-08
2+
Version: 0.7-12
3+
Date: 2017-08-10
44
Title: R Database Interface
55
Description: A database interface definition for communication
66
between R and relational database management systems. All

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ exportMethods(dbDataType)
6868
exportMethods(dbExecute)
6969
exportMethods(dbFetch)
7070
exportMethods(dbGetQuery)
71+
exportMethods(dbListFields)
7172
exportMethods(dbQuoteIdentifier)
7273
exportMethods(dbQuoteString)
7374
exportMethods(dbReadTable)

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## DBI 0.7-12 (2017-08-10)
2+
3+
- Add default implementation of `dbListFields()`.
4+
5+
16
## DBI 0.7-11 (2017-08-08)
27

38
- The default implementation of `dbReadTable()` now has `row.names = FALSE` as default and also supports `row.names = NULL` (#186).

R/DBConnection.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,18 @@ setGeneric("dbListFields",
294294
valueClass = "character"
295295
)
296296

297+
#' @rdname hidden_aliases
298+
#' @export
299+
setMethod("dbListFields", c("DBIConnection", "character"),
300+
function(conn, name, ...) {
301+
rs <- dbSendQuery(conn, paste("SELECT * FROM ",
302+
dbQuoteIdentifier(conn, name), "LIMIT 0"))
303+
on.exit(dbClearResult(rs))
304+
305+
names(dbFetch(rs, n = 0, row.names = FALSE))
306+
}
307+
)
308+
297309
#' List remote tables
298310
#'
299311
#' Returns the unquoted names of remote tables accessible through this

man/hidden_aliases.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)