Methods like db_compute() and db_copy_to() currently require a real database to be tested against. Suggesting the following approach:
- Define a
db_execute() generic, implement it only for the "TestConnection" class (which would print the SQL) and for "DBIConnection" (which forwards to DBI::dbExecute())
- Replace all calls to
DBI::dbExecute() with calls to db_execute()
- Run tests with
simulate_dbi(...), capture output
Reference: https://github.com/tidyverse/dbplyr/pull/280/files#r275091349
Methods like
db_compute()anddb_copy_to()currently require a real database to be tested against. Suggesting the following approach:db_execute()generic, implement it only for the"TestConnection"class (which would print the SQL) and for"DBIConnection"(which forwards toDBI::dbExecute())DBI::dbExecute()with calls todb_execute()simulate_dbi(...), capture outputReference: https://github.com/tidyverse/dbplyr/pull/280/files#r275091349