You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the postgres enum type is not quite supported yet, although there is a workaround:
library(adbcdrivermanager)
db<- adbc_database_init(
adbcpostgresql::adbcpostgresql(),
uri="postgresql://localhost:5432/postgres?user=postgres&password=password")
db|>
execute_adbc("CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy')")
db|>
adbc_database_release()
# Have to recreate the database after because that's where we cache the typescon<-db<- adbc_database_init(
adbcpostgresql::adbcpostgresql(),
uri="postgresql://localhost:5432/postgres?user=postgres&password=password"
) |>
adbc_connection_init()
con|>
execute_adbc("CREATE TABLE x (a mood)") |>
execute_adbc("INSERT INTO x VALUES ('sad')") |>
execute_adbc("INSERT INTO x VALUES ('ok')")
# Currently returned as binary (i.e., COPY output)con|>
read_adbc("SELECT * from x") |>
as.data.frame() |>dplyr::pull(a) |>
unclass() |>
vapply(rawToChar, character(1))
#> [1] "sad" "ok"
Activity
lidavidm commentedon Jan 23, 2024
It would also be good to have a way to purge the cache or notice that we need to rebuild it, hmm
feat(c/driver/postgresql): Add enum type support (#1485)