Creation and basic functionality

dm() new_dm() validate_dm() dm_get_src() dm_get_con() dm_get_tables() is_dm() as_dm()

Data model class

dm_from_src()

Load a dm from a remote data source

dm_paste()

Create R code for a dm object

Tables

dm_add_tbl()

Add tables to a dm

dm_rm_tbl()

Remove tables

dm_mutate_tbl()

Update tables in a dm

dm_select_tbl() dm_rename_tbl()

Select and rename tables

pull_tbl()

Retrieve a table

dm_bind()

Merge several dm

Table retrieval, table info and DB interaction methods (`dplyr`)

tbl(<dm>) compute(<dm>) compute(<zoomed_dm>) src_tbls(<dm>) copy_to(<dm>) collect(<dm>)

dplyr table retrieval, table info and DB interaction methods

Primary keys

dm_add_pk() dm_rm_pk()

Add/remove a primary key

dm_has_pk()

Check for primary key

dm_get_pk()

Primary key column names

dm_get_all_pks()

Get all primary keys of a dm object

enum_pk_candidates() dm_enum_pk_candidates()

Primary key candidate

Foreign keys

dm_add_fk() dm_rm_fk()

Add/remove foreign keys

dm_has_fk()

Check if foreign keys exists

dm_get_fk()

Foreign key column names

dm_get_all_fks()

Get foreign key constraints

dm_enum_fk_candidates() enum_fk_candidates()

Foreign key candidates

dm_is_referenced()

Check foreign key reference

dm_get_referencing_tables()

Get the names of referencing tables

Visualization

dm_draw() dm_set_colors() dm_get_colors() dm_get_available_colors()

Draw a diagram of the data model

Zooming

dm_zoom_to() dm_insert_zoomed() dm_update_zoomed() dm_discard_zoomed()

Mark table for manipulation

filter(<zoomed_dm>) mutate(<zoomed_dm>) transmute(<zoomed_dm>) select(<zoomed_dm>) rename(<zoomed_dm>) distinct(<zoomed_dm>) arrange(<zoomed_dm>) slice(<zoomed_dm>) group_by(<zoomed_dm>) ungroup(<zoomed_dm>) summarise(<zoomed_dm>) count(<zoomed_dm>) tally(<zoomed_dm>) pull(<zoomed_dm>)

dplyr table manipulation methods for zoomed dm objects

unite(<zoomed_dm>) separate(<zoomed_dm>)

tidyr table manipulation methods for zoomed dm objects

left_join(<zoomed_dm>) inner_join(<zoomed_dm>) full_join(<zoomed_dm>) right_join(<zoomed_dm>) semi_join(<zoomed_dm>) anti_join(<zoomed_dm>)

dplyr join methods for zoomed dm objects

head(<zoomed_dm>) tail(<zoomed_dm>)

utils table manipulation methods for zoomed_dm objects

Flattening

dm_flatten_to_tbl() dm_squash_to_tbl()

Flatten a part of a dm into a wide table

dm_join_to_tbl()

Join two tables

dm_disambiguate_cols()

Resolve column name ambiguities

Filtering

dm_filter() dm_apply_filters() dm_apply_filters_to_tbl()

Filtering

dm_get_filters()

Get filter expressions

Column selection

dm_rename()

Rename columns

dm_select()

Select columns

Upload

copy_dm_to()

Copy data model to data source

dm_rows_insert() dm_rows_update() dm_rows_patch() dm_rows_upsert() dm_rows_delete() dm_rows_truncate()

Modifying rows for multiple tables

rows_insert(<tbl_dbi>) rows_update(<tbl_dbi>) sql_rows_insert() sql_rows_update()

Updating database tables

rows_truncate() sql_rows_truncate()

Truncate all rows

Table surgery

decompose_table()

Decompose a table into two linked tables

reunite_parent_child() reunite_parent_child_from_list()

Merge two tables that are linked by a foreign key relation

Check keys and cardinalities

dm_examine_constraints()

Validate your data model

check_cardinality_0_n() check_cardinality_1_n() check_cardinality_1_1() check_cardinality_0_1() examine_cardinality()

Check table relations

check_key()

Check if column(s) can be used as keys

check_subset()

Check column values for subset

check_set_equality()

Check column values for set equality

Miscellaneous

dm_nycflights13()

Creates a dm object for the nycflights13 data

dm_financial() dm_financial_sqlite()

Creates a dm object for the Financial data

dm_nrow()

Number of rows

dm_ptype()

Prototype for a dm object