So it's possible to create a table in a database using dplyr::copy_to()
, but wouldn't it be cool if instead of creating ONE table it could optionally create multiple related tables (if specified to do so by the user)?
For example, consider the following dataset:
If we wanted to convert this to a database schema, it probably makes more sense to convert this into two related tables:
which are linked together as such:
The fields could be mapped to one table or another using new inputs from the user, or by requiring a separate data.frame where the table-fields are mapped, or other hacky methods.
So I have two questions:
- Do you all think it's a good idea? To be able to engineer a database from R?
- Do you think
dplyr
is the correct place for this? or should I create a separate package for this functionality.