diff --git a/DESCRIPTION b/DESCRIPTION index 6e36c9e2a..b2c60703a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -96,6 +96,7 @@ Collate: 'spec-sql-remove-table.R' 'spec-sql-list-objects.R' 'spec-meta-bind-runner.R' + 'spec-meta-bind-formals.R' 'spec-meta-bind.R' 'spec-meta-bind-.R' 'spec-meta-is-valid.R' diff --git a/R/spec-.R b/R/spec-.R index 92413523e..ddd210427 100644 --- a/R/spec-.R +++ b/R/spec-.R @@ -49,6 +49,7 @@ #' @include spec-meta-is-valid.R #' @include spec-meta-bind-.R #' @include spec-meta-bind.R +#' @include spec-meta-bind-formals.R #' @include spec-meta-bind-runner.R #' @include spec-sql-list-objects.R #' @include spec-sql-remove-table.R diff --git a/R/spec-meta-bind-formals.R b/R/spec-meta-bind-formals.R new file mode 100644 index 000000000..834caab72 --- /dev/null +++ b/R/spec-meta-bind-formals.R @@ -0,0 +1,22 @@ +#' spec_meta_bind +#' @name spec_meta_bind +#' @family meta specifications +#' @aliases NULL +#' @usage NULL +#' @format NULL +#' @keywords NULL +spec_meta_bind_formals <- list( + bind_formals = function() { + # + expect_equal(names(formals(dbBind)), c("res", "params", "...")) + }, + #' + bind_empty = function(con) { + #' @section Failure modes: + #' Calling `dbBind()` for a query without parameters + res <- local_result(dbSendQuery(con, trivial_query())) + #' raises an error. + expect_error(dbBind(res, list())) + }, + NULL +) diff --git a/R/spec-meta-bind.R b/R/spec-meta-bind.R index 66ea7b839..166f95ab8 100644 --- a/R/spec-meta-bind.R +++ b/R/spec-meta-bind.R @@ -4,11 +4,6 @@ #' @format NULL #' @keywords NULL spec_meta_bind <- list( - bind_formals = function() { - # - expect_equal(names(formals(dbBind)), c("res", "params", "...")) - }, - # bind_return_value = function(ctx, con) { #' @return check_return_value <- function(bind_res, res) { @@ -43,16 +38,9 @@ spec_meta_bind <- list( query = FALSE ) }, - #' - bind_empty = function(con) { - #' @section Failure modes: - #' Calling `dbBind()` for a query without parameters - res <- local_result(dbSendQuery(con, trivial_query())) - #' raises an error. - expect_error(dbBind(res, list())) - }, # bind_too_many = function(ctx, con) { + #' @section Failure modes: patch_bind_values <- function(bind_values) { #' Binding too many if (is.null(names(bind_values))) { diff --git a/R/spec-meta.R b/R/spec-meta.R index 644cd1ac3..74c6c321c 100644 --- a/R/spec-meta.R +++ b/R/spec-meta.R @@ -1,5 +1,6 @@ #' @format NULL spec_meta <- c( + spec_meta_bind_formals, spec_meta_bind, spec_meta_is_valid, spec_meta_has_completed, diff --git a/man/spec_meta_bind.Rd b/man/spec_meta_bind.Rd index 061822206..9b4b1f6e5 100644 --- a/man/spec_meta_bind.Rd +++ b/man/spec_meta_bind.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/spec-meta-bind-runner.R, R/spec-meta-bind.R +% Please edit documentation in R/spec-meta-bind-runner.R, +% R/spec-meta-bind-formals.R, R/spec-meta-bind.R \docType{data} \name{spec_meta_bind} \alias{spec_meta_bind} @@ -14,6 +15,8 @@ and also for data manipulation statements issued by \description{ spec_meta_bind +spec_meta_bind + spec_meta_bind } \section{Specification}{ @@ -106,6 +109,8 @@ and with the value stored as integer) Calling \code{dbBind()} for a query without parameters raises an error. + + Binding too many or not enough values, or parameters with wrong names @@ -135,6 +140,15 @@ Other meta specifications: \code{\link{spec_meta_has_completed}}, \code{\link{spec_meta_is_valid}} +Other meta specifications: +\code{\link{spec_get_info}}, +\code{\link{spec_meta_column_info}}, +\code{\link{spec_meta_get_row_count}}, +\code{\link{spec_meta_get_rows_affected}}, +\code{\link{spec_meta_get_statement}}, +\code{\link{spec_meta_has_completed}}, +\code{\link{spec_meta_is_valid}} + Other meta specifications: \code{\link{spec_get_info}}, \code{\link{spec_meta_column_info}},