File: dbCreateTable_DBIConnection.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 (31 lines) | stat: -rw-r--r-- 574 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
29
30
31
#' @rdname hidden_aliases
#' @usage NULL
dbCreateTable_DBIConnection <- function(
  conn,
  name,
  fields,
  ...,
  row.names = NULL,
  temporary = FALSE
) {
  stopifnot(is.null(row.names))
  stopifnot(is.logical(temporary), length(temporary) == 1L)

  query <- sqlCreateTable(
    con = conn,
    table = name,
    fields = fields,
    row.names = row.names,
    temporary = temporary,
    ...
  )
  dbExecute(conn, query)
  invisible(TRUE)
}
#' @rdname hidden_aliases
#' @export
setMethod(
  "dbCreateTable",
  signature("DBIConnection"),
  dbCreateTable_DBIConnection
)