Skip to content

Proper implementation for dbDataType() #15

@nbenn

Description

@nbenn

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions