duckdb-r icon indicating copy to clipboard operation
duckdb-r copied to clipboard

Revisit `tbl.duckdb_connection()`

Open krlmlr opened this issue 8 months ago • 3 comments

I don't understand the code and the test:

https://github.com/duckdb/duckdb-r/blob/aef914bf34f4ff7dd17b3c6f5b97586f04a9c93f/R/backend-dbplyr__duckdb_connection.R#L370-L379

https://github.com/duckdb/duckdb-r/blob/aef914bf34f4ff7dd17b3c6f5b97586f04a9c93f/tests/testthat/test_tbl__duckdb_connection.R#L30-L43

I have the following questions:

  • What is this object cache for parquet files?
  • We're only executing the PRAGMA with cache = TRUE, is this desired? Should we also run it with cache = FALSE?
  • Does the PRAGMA give a permanent side effect on the connection (yes according to the test)? Should we reset it afterward?
  • To my understanding, the use of ident_q() is discouraged and also has no effect here because we're using NextMethod() . What's the intention here, do we need it?
  • Extra arguments to tbl() seem to be broken via https://github.com/tidyverse/dbplyr/issues/1384, should we perhaps offer a different, more robust API? We could implement a dedicated function that documents all available pragmas and perhaps even offers them as autocomplete.

CC @mgirlich + @hannes.

krlmlr avatar Oct 27 '23 14:10 krlmlr