Experimental lifecycle

The prototype contains all tables, all primary and foreign keys, but no data. All tables are truncated and converted to zero-row tibbles. Column names retain their type. This is useful for performing creation and population of a database in separate steps.

dm_ptype(dm)

Arguments

dm

A dm object.

Examples

if (rlang::is_installed("RMariaDB") && getRversion() >= 3.5) (if (getRversion() >= "3.4") withAutoprint else force)({ # examplesIf dm_financial() %>% dm_ptype() dm_financial() %>% dm_ptype() %>% dm_nrow() }) # examplesIf
#> > dm_financial() %>% dm_ptype() #> ── Table source ──────────────────────────────────────────────────────────────── #> src: <environment: R_GlobalEnv> #> ── Metadata ──────────────────────────────────────────────────────────────────── #> Tables: `accounts`, `cards`, `clients`, `disps`, `districts`, … (9 total) #> Columns: 57 #> Primary keys: 8 #> Foreign keys: 7 #> > dm_financial() %>% dm_ptype() %>% dm_nrow() #> accounts cards clients disps districts loans orders tkeys #> 0 0 0 0 0 0 0 0 #> trans #> 0