Skip to content

Clarify fetch_no_return_value test: shouldn't call dbFetch() on a dbSendStatement() result #409

Open
@MichaelChirico

Description

@MichaelChirico

fetch_no_return_value = function(con, table_name) {
#'
#' Calling `dbFetch()` on a result set from a data manipulation query
#' created by [dbSendStatement()] can
#' be fetched and return an empty data frame, with a warning.
query <- paste0("CREATE TABLE ", table_name, " (a integer)")
res <- local_result(dbSendStatement(con, query))
expect_warning(rows <- check_df(dbFetch(res)))
expect_identical(rows, data.frame())
},

I'm not sure I understand this, and the example is using dbSendStatement() in a way that differs slightly from the documentation I see (which covers INSERT/UPDATE/DELETE but not CREATE statements).

Do you have an example of a backend that implements this as intended? It's also a bit hard to search for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions