apache / arrow-adbc

Database connectivity API standard and libraries for Apache Arrow
https://arrow.apache.org/adbc/
Apache License 2.0
364 stars 89 forks source link

r/adbcdrivermanager: Expose SQL type mapping #1394

Open nbenn opened 9 months ago

nbenn commented 9 months ago

For the DBI integration of ADBC via adbcdrivermanager (adbi), I need a way to determine the SQL type that corresponds to a given R type. Something like

DBI::dbDataType(DBI::ANSI(), integer())
#> [1] "INT"
DBI::dbDataType(DBI::ANSI(), character())
#> [1] "TEXT"

As adbi is backend-agnostic, I cannot solve this issue as part of adbi, but need infrastructure to delegate such requests to. A first iteration (as discussed) could be a (doubly dispatched) generic in adbcdrivermanager that for a given combination of backend and R type returns the corresponding SQL type.

lidavidm commented 9 months ago

I filed #1398 to track what we could do from the underlying driver side