File: dbGetConnectArgs.R

package info (click to toggle)
dbi 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,740 kB
  • sloc: makefile: 2
file content (28 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#' Get connection arguments
#'
#' Returns the arguments stored in a [DBIConnector-class] object for inspection,
#' optionally evaluating them.
#' This function is called by [dbConnect()]
#' and usually does not need to be called directly.
#'
#' @template methods
#' @templateVar method_name dbGetConnectArgs
#'
#' @param drv A object inheriting from [DBIConnector-class].
#' @param eval Set to `FALSE` to return the functions that generate the argument
#'   instead of evaluating them.
#' @param ... Other arguments passed on to methods. Not otherwise used.
#' @family DBIConnector generics
#' @examplesIf requireNamespace("RSQLite", quietly = TRUE)
#' cnr <- new("DBIConnector",
#'   .drv = RSQLite::SQLite(),
#'   .conn_args = list(dbname = ":memory:", password = function() "supersecret")
#' )
#' dbGetConnectArgs(cnr)
#' dbGetConnectArgs(cnr, eval = FALSE)
#' @export
setGeneric(
  "dbGetConnectArgs",
  def = function(drv, eval = TRUE, ...) standardGeneric("dbGetConnectArgs"),
  valueClass = "list"
)