getFormSchema() has a method that allows you to transform it into a data.frame but getDatabaseSchema() currently does not.
it'll be nice to get the database schema into a data.frame format as well so that updates to the database schema can also be handled via data.frames , similar to #33
afda_schema <- getDatabaseSchema("c5h9mudkz3sqce52")
## Tables come from the "resources" list
## turn below code into a function
## Get table labels
tab_label <- afda_schema %>%
purrr::pluck("resources") %>%
purrr::map(pluck("label")) %>% unlist()
## Get table IDs
tab_id <- afda_schema %>%
purrr::pluck("resources") %>%
purrr::map(pluck("id")) %>%
unlist()
## put 'em together to create a nice look-up
data.frame(
Table = tab_label,
table_id = tab_id
)
``
Split from https://github.com/bedatadriven/activityinfo-R/issues/32#issuecomment-1354759271
getFormSchema() has a method that allows you to transform it into a data.frame but getDatabaseSchema() currently does not.
it'll be nice to get the database schema into a data.frame format as well so that updates to the database schema can also be handled via data.frames , similar to #33