Renamed Manage.R -> Database.R

This commit is contained in:
2020-10-15 11:03:18 +01:00
parent 2bf9b2bf8d
commit dea358d146

View File

@@ -80,7 +80,7 @@ modb_connect <- function(username, password, database,
checkmate::assert_string(host) checkmate::assert_string(host)
checkmate::assert_int(port, lower = 1, upper = 65535) checkmate::assert_int(port, lower = 1, upper = 65535)
res <- .Call( res <- .Call(
c_modb_connectToHost, c_rmodb_connectToHost,
conn_name, conn_name,
host, host,
as.integer(port), as.integer(port),
@@ -90,7 +90,7 @@ modb_connect <- function(username, password, database,
) )
} else { } else {
res <- .Call( res <- .Call(
c_modb_connectToSocket, conn_name, socket, username, password, database c_rmodb_connectToSocket, conn_name, socket, username, password, database
) )
} }
@@ -108,7 +108,7 @@ modb_connect <- function(username, password, database,
#' @param ... conn_id, conn_name or conn_ref required. See \link{modb_conn_ref} #' @param ... conn_id, conn_name or conn_ref required. See \link{modb_conn_ref}
#' @export #' @export
modb_disconnect <- function(...) { modb_disconnect <- function(...) {
res <- .Call(c_modb_disconnect, modb_conn_ref(args = list(...))) res <- .Call(c_rmodb_disconnect, modb_conn_ref(args = list(...)))
return(invisible(res)) return(invisible(res))
} }
@@ -123,7 +123,7 @@ modb_disconnect <- function(...) {
modb_connectionInfo <- function(stop_on_error = TRUE, ...) { modb_connectionInfo <- function(stop_on_error = TRUE, ...) {
conn_ref <- modb_conn_ref(args = list(...)) conn_ref <- modb_conn_ref(args = list(...))
utils::str(conn_ref) utils::str(conn_ref)
res <- .Call(c_modb_connectionInfo, conn_ref) res <- .Call(c_rmodb_connectionInfo, conn_ref)
if (length(res) == sum(is.na(res))) { if (length(res) == sum(is.na(res))) {
if (stop_on_error) { if (stop_on_error) {
@@ -143,7 +143,7 @@ modb_connectionInfo <- function(stop_on_error = TRUE, ...) {
#' @return TRUE if the connection exists, FALSE if not. #' @return TRUE if the connection exists, FALSE if not.
#' @export #' @export
modb_connectionExists <- function(...) { modb_connectionExists <- function(...) {
res <- .Call(c_modb_connectionInfo, modb_conn_ref(args = list(...))) res <- .Call(c_rmodb_connectionInfo, modb_conn_ref(args = list(...)))
return(!(length(res) == sum(is.na(res)))) return(!(length(res) == sum(is.na(res))))
} }
@@ -176,7 +176,7 @@ modb_connectionName <- function(conn_id, stop_on_error = TRUE) {
#' @export #' @export
modb_exists <- function(modb_name, ...) { modb_exists <- function(modb_name, ...) {
conn_ref <- modb_conn_ref(args = list(...)) conn_ref <- modb_conn_ref(args = list(...))
res <- .Call(c_modb_exists, conn_ref, modb_name) res <- .Call(c_rmodb_exists, conn_ref, modb_name)
return(res) return(res)
} }
#' @export #' @export
@@ -215,19 +215,19 @@ modb_create <- function(modb_name, extended_meta = NULL, ...) {
} }
conn_ref <- modb_conn_ref(args = list(...)) conn_ref <- modb_conn_ref(args = list(...))
res <- .Call(c_modb_create, conn_ref, modb_name, extended_meta) res <- .Call(c_rmodb_create, conn_ref, modb_name, extended_meta)
return(res) return(res)
} }
#' @export #' @export
modb_destroy <- function(modb_name, ...) { modb_destroy <- function(modb_name, ...) {
conn_ref <- modb_conn_ref(args = list(...)) conn_ref <- modb_conn_ref(args = list(...))
res <- .Call(c_modb_destroy, conn_ref, modb_name) res <- .Call(c_rmodb_destroy, conn_ref, modb_name)
return(res) return(res)
} }
#' @export #' @export
modb_use <- function(modb_name, override = FALSE, ...) { modb_use <- function(modb_name, override = FALSE, ...) {
conn_ref <- modb_conn_ref(args = list(...)) conn_ref <- modb_conn_ref(args = list(...))
res <- .Call(c_modb_use, conn_ref, modb_name, as.logical(override)) res <- .Call(c_rmodb_use, conn_ref, modb_name, as.logical(override))
return(res) return(res)
} }