bedatadriven / activityinfo-R

ActivityInfo R Language Client
https://www.activityinfo.org/support/docs/R/
18 stars 12 forks source link

keep `key` column for form schema when coercing to data.frame #17

Closed Ryo-N7 closed 2 years ago

Ryo-N7 commented 3 years ago

Hi all,

For the database introspection tool I would like to check for key fields in each table.

It appears that here: https://github.com/bedatadriven/activityinfo-R/blob/master/R/forms.R#L188 the method for coercing the form schema to a data.frame removes the column.

Could we please remove the line so we can keep it in?

Thanks!

Ryo

mjkallen commented 3 years ago

Available in the version-4.20 branch:

library("remotes")
remotes::install_github("bedatadriven/activityinfo-R", ref = "version-4.20")

library("activityinfo")
form.schema <- getFormSchema("{formId}")
as.data.frame(form.schema)
Ryo-N7 commented 3 years ago

Thanks, I tried it and looks good to me!