Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper implementation for dbDataType() #15

Open
nbenn opened this issue Dec 18, 2023 · 1 comment
Open

Proper implementation for dbDataType() #15

nbenn opened this issue Dec 18, 2023 · 1 comment

Comments

@nbenn
Copy link
Member

nbenn commented Dec 18, 2023

Currently we have

db_data_type <- function(x, drv) {
if (inherits(x, "blob")) {
db_data_type_blob(drv)
} else {
dbDataType(ANSI(), x)
}
}

and

adbi/R/utils.R

Lines 52 to 65 in 3149da7

db_data_type_blob <- function(drv) {
if (inherits(drv, "adbcsqlite_driver_sqlite")) {
"BLOB"
} else if (inherits(drv, "adbcpostgresql_driver_postgresql")) {
"bytea"
} else {
stop(
"dbDataType for blob objects unknown for type ",
paste0(class(drv), collapse = ", "),
call. = FALSE
)
}
}

How can we do better?

  • Have adbcdrivermanager introduce a generic for this?
  • Introduce our own generic?
@nbenn
Copy link
Member Author

nbenn commented Dec 22, 2023

See also apache/arrow-adbc#1394.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant