Repository navigation
feat: Reexport the Arrow generics from DBI - #584
Conversation
DBI's default methods for `dbGetQueryArrow()` and friends now apply to RMariaDB's classes. `R/export.R` is generated by the new `tests/testthat/helper-reexport.R`, as in RSQLite, which also exports `dbGetConnectArgs()`. The "reexport" DBItest skip is gone, and the remaining Arrow skips name their cause. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Question: Where to fix the spurious loss-of-precision warning (#586)Two
If nobody decides, the skips stay and #586 remains open. Generated by Claude Code |
…ification Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Question: Harden the
|
Accepted limitations
Generated by Claude Code |
RMariaDB now supports the DBI Arrow interface (
dbGetQueryArrow(),dbSendQueryArrow(),dbFetchArrow(),dbFetchArrowChunk(),dbReadTableArrow(),dbWriteTableArrow(),dbAppendTableArrow(),dbCreateTableArrow(),dbBindArrow()). It does this the same way RSQLite'smaindoes: it reexports DBI's generics, so DBI's default methods, which go through data frames, apply to RMariaDB's classes.This is the bottom layer. A native implementation following RSQLite's open stack (r-dbi/RSQLite#880) will be proposed separately. It will build on the per-chunk column store from #587.
Changes
tests/testthat/helper-reexport.R(new) generatesR/export.R. It is RSQLite's generator, written in base R instead of with%>%, because RMariaDB doesn't suggest magrittr.R/export.Ris regenerated. It covers all DBI generics, including the 9 Arrow ones anddbGetConnectArgs(), and drops a duplicatedbQuoteLiteralentry.NAMESPACEgains theexportMethods()lines.DESCRIPTIONnow importsDBI (>= 1.2.3). RSQLite requires 1.2.0, but DBI 1.2.0's default Arrow methods don't follow the specification yet:dbCreateTableArrow()has notemporaryargument, anddbAppendTableArrow()returns no row count. 1.2.3 is also what DBItest 1.9.0 requires.tests/testthat/helper-DBItest.Rdrops thereexportskip. The remaining Arrow skips are linked todbCreateTable()with a zero-row data frame makes character columnsVARCHAR(1)#585 (fixed in fix:dbCreateTable()gives character columns of zero-row data frames a type that holds any string #588, stacked on this PR) and Arrow timestamp round trip warns about loss of precision that doesn't happen #586.Tests
Run locally against MariaDB 10.11 with DBI 1.3.0, DBItest 1.9.0 and nanoarrow 0.9.0, with
NOT_CRAN=true.dbCreateTable()with a zero-row data frame makes character columnsVARCHAR(1)#585 and Arrow timestamp round trip warns about loss of precision that doesn't happen #586.reexportpasses with the package installed. Underload_all(), DBItest skips it.--no-manual) found no problems in the code, namespace or Rd files.test-timezone.Rerror that also happens onmainin this container (CCTZ doesn't recognize "US/Alaska").A clean review found nothing above Low. See the questions and the "Accepted limitations" comment below.
Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Generated by Claude Code