-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #375 #411
Issue #375 #411
Conversation
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
who knows. somehow my master branch is ahead of this one?
keeping uptodate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks great.
howto-dm-load.Rmd
looks like a copy ofhowto-dm-db.Rmd
. I like the old name better. Should we copy over and consolidate the cross references?howto-dm-persist.Rmd
looks like an unfinished stub, do we still need it?- I tweaked a bit, please pull from the branch before you resume.
vignettes/howto-dm-copy.Rmd
Outdated
Using {dm} you can persist an entire relational model with a single function call or piece by piece. | ||
`copy_dm_to()` will move your entire model into a destination RDBMS. | ||
This may be all you need to deploy a new data model. | ||
Considerations for which approach to use depend on a number of factors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to mention compute()
here?
vignettes/howto-dm-copy.Rmd
Outdated
In this tutorial we run through techniques for persisting an entire relational model as well as individual tables. | ||
For modifying and persisting changes to your relational model at the row-level see `vignette("howto-dm-rows")`. | ||
|
||
## Copying a complete relational model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this section be named "Overview" or similar?
vignettes/howto-dm-rows.Rmd
Outdated
| dm_rows_truncate() | Removes all records, only for tables in dm. Truncation is performed by truncating child tables before parent tables. | | ||
|
||
For `dm_rows_delete()` and `dm_rows_truncate()` tables linked to other tables via foreign keys are processed first. | ||
For example, a database of nations with three linked tables, Country <- Province <- City. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would howto-dm-theory.Rmd
be a better fit for this example?
vignettes/howto-dm-rows.Rmd
Outdated
Table modification methods work as expected on local dm objects, returning a new dm with the modifications in place. | ||
dm objects whose source is a database treat all operations as temporary unless you request explicitly to commit them by including the argument `temporary=FALSE`. | ||
|
||
Below we copy `demo_dm` into an SQLite database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we start by copying the empty structure into the database and then adding the rows with copy_dm_to(temporary = FALSE) %>% dm_rows_insert()
? It's good practice to separate model creation from database population.
Thanks! |
dm 0.1.9 - New `vignette("howto-dm-copy", package = "dm")` and `vignette("howto-dm-rows", package = "dm")` discuss updating data on the database. In part derived from `vignette("howto-dm-db", package = "dm")` (#411, @jawond). - New `dm_mutate_tbl()` (#448). - `dm_financial()` falls back to db-edu.pacha.dev if relational.fit.cvut.cz is unavailable (#446, @pachamaltese). - Use testthat 3e (#455).
@krlmlr first partial draft of persistence tutorials. Got stuck loading data into a dm.
Closes #375.