Skip to content

Get database resources as a table #61

@akbertram

Description

@akbertram

Split from #32 (comment)

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
)
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions