Skip to content

Commit 6728ec1

Browse files
committed
placeholder
1 parent cce14f8 commit 6728ec1

File tree

2 files changed

+70
-71
lines changed

2 files changed

+70
-71
lines changed

R/spec-meta-bind-runner.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ test_select_bind_expr_one$fun <- function(
5555
#' Mixing placeholders (in particular, named and unnamed ones) is not
5656
#' recommended.
5757
send_expr <- if (query) rlang::expr({
58-
placeholder <- placeholder_fun(!!length(bind_values))
5958
placeholder_values <- map_chr(bind_values, function(x) DBI::dbQuoteLiteral(con, x[1]))
6059
result_check <- paste0("(", (!!cast_fun_placeholder_expr), " = ", placeholder_values, ")")
6160
!!if (length(is_na) > 0) rlang::expr({
@@ -83,7 +82,6 @@ test_select_bind_expr_one$fun <- function(
8382
dbWriteTable(con, table_name, data, temporary = TRUE)
8483

8584
value_names <- letters[!!construct_expr(seq_along(bind_values))]
86-
placeholder <- placeholder_fun(!!length(bind_values))
8785
sql <- paste0(
8886
"UPDATE ", dbQuoteIdentifier(con, table_name), " SET b = b + 1 WHERE ",
8987
paste(value_names, " = ", placeholder, collapse = " AND ")
@@ -135,7 +133,8 @@ test_select_bind_expr_one$fun <- function(
135133
#' Named values are matched to named parameters, unnamed values
136134
#' are matched by position in the list of parameters.
137135
name_values_expr <- rlang::expr({
138-
names(bind_values) <- names(placeholder_fun(!!length(bind_values)))
136+
placeholder <- placeholder_fun(!!length(bind_values))
137+
names(bind_values) <- names(placeholder)
139138
})
140139

141140
check_return_value_expr <- if (!is.null(check_return_value)) rlang::expr({

0 commit comments

Comments
 (0)