dm_get_src()
returns NULL
for local data sources (#394).copy_dm_to()
gives a deprecation message (#395).copy_dm_to()
gives a better error message for bad table_names
(#397).dm
objects with local data sources no longer show the “Table source” part in the output.dm_bind()
for binding two or more ‘dm’ objects together (#417).dm_financial()
no longer prints message about learn_keys = FALSE
.dm_rows_update()
and related functions now use the primary keys defined in x
for establishing matching rows.withCallingHandlers()
where appropriate (#422)..dm
and .zoomed_dm
methods (#300).dm_financial()
are not run if connection can’t be established (#418).dm_paste()
generates self-contained code (#401).rows_truncate()
for databases.collect()
works on a zoomed dm, with a message.dm_add_pk(check = TRUE)
gives a better error message.rows_insert()
works if column names consist of SQL keywords (#409).src_sqlite()
in examples (#372).New dm_rows_insert()
, dm_rows_update()
, dm_rows_patch()
, dm_rows_upsert()
, dm_rows_delete()
and dm_rows_truncate()
, calling the corresponding rows_*()
method for every table (#319).
New rows_truncate()
(#319).
Added rows_insert()
and rows_update()
methods for SQLite, Postgres, MariaDB and MSSQL (#319).
Missing arguments now give a better error message (#388).
Empty dm
object prints as dm()
(#386).
copy_dm_to()
also accepts a function as the table_names
argument. The unique_table_names()
argument is deprecated (#80).
Add TL;DR to README (#377, @jawond).
Add content from old README to howto-dm-theory.Rmd
(#378, @jawond).
Require dplyr >= 1.0.0.
Use GitHub Actions (#369, @pat-s).
src_sqlite()
in vignettes (#372)."dm_error_tables_not_neighbours"
to "dm_error_tables_not_neighbors"
.dm_from_src()
now works for databases other than Postgres and MSSQL (#288), gives a warning if tables cannot be accessed with table_name = NULL
(#348), and gains learn_keys
argument to control querying of primary and foreign keys from the database (#340).dm_examine_constraints()
now prints a different message if a dm has no constraints defined."zoomed_dm"
: head()
, tail()
, pull()
, group_data()
, group_indices()
, group_vars()
, group_keys()
and groups()
(#236, #203).dm_paste()
supports writing colors and the table definition via the new options
argument. The definition can be written to a file via the new path
argument. The select
argument is soft-deprecated (#218, #302).dm_add_tbl()
uses rlang::list2()
internally, now accepts :=
to specify table names.dm_ptype()
(#301).dm_financial()
and dm_financial_sqlite()
.check_key()
now also works on a zoomed dm.dm_add_pk()
, dm_rm_pk()
, dm_add_fk()
and dm_rm_fk()
are now stricter when keys exists or when attempting to remove keys that don’t exist. A more relaxed mode of operation may be added later (#214).examine_cardinality()
, dm_examine_constraints()
and enum_pk_candidates()
now work for columns named n
.dm_set_key_constraints()
(and by extension dm_copy_to(set_key_constraints = TRUE)
) now quote identifiers for the SQL that creates foreign keys on the database.collect()
gives a better error message when called on a "zoomed_dm"
(#294).check_subset()
gives a clean error message if the tables are complex expressions.dm_from_src(schema = "...")
works on Postgres if search_path
is not set on the connection.compute.zoomed_dm()
no longer throws an error.src_df()
(#336).dm_draw()
output is shown in examples (#251).dm_nycflights13(subset = TRUE)
memoizes subset and also reduces the size of the weather
table.format.dm()
.dm_examine_constraints()
formats the problems nicely.dm_from_src()
for Postgres through the new schema
and table_type
arguments (#256).filter.zoomed_dm()
no longer sets the filter.examine_()
functions never throw an error (#238).dm_zoom_to()
, dm_insert_zoomed()
, dm_update_zoomed()
and dm_discard_zoomed()
; check_()
-> examine_()
; dm_get_filter()
-> dm_get_filters()
; dm_from_src()
+ dm_learn_from_db()
-> dm_from_src()
(#233).$.zoomed_dm()
, [.zoomed_dm()
, [[.zoomed_dm()
, length.zoomed_dm()
, names.zoomed_dm()
, tbl_vars.zoomed_dm()
(#199, #216).as.list()
methods (#213).dm_examine_constraints()
and other key-related functions for compound keys (#239).R CMD check
with dev versions of dependencies.cdm_
prefix to dm_
. The old names are still available (#117).pull_tbl()
extracts a single table from a dm
(#206).dm_apply_filters_to_tbl()
that applies filters in related tables to a table, similar to dm_apply_filters()
; tbl()
, $
and [[
no longer apply filter conditions defined in related tables (#161).dm_paste()
(#160).check_cardinality()
returns the nature of the relationship between parent_table$pk_col
and child_table$fk_col
(#15).check_key()
no longer maps empty selection list to all columns.check_key()
supports tidyselect (#188).dm_rm_tbl()
supports tidyselect (#127).decompose_table()
uses tidyselect (#194).copy_to()
for dm
objects (#129).ref_table
column in dm_check_constraints()
(#178).str()
shows simplified views (#123).validate_dm()
(#173).dm_rm_fk()
(#175).check_key()
for databases (#208).cdm_filter()
and filter.zoomed_dm()
apply the filter instantly, the expression is recorded only for display purposes and for terminating the search for filtered tables in cdm_apply_filters()
. This now allows using a variety of operations on filtered dm
objects (#124).dimnames()
, colnames()
, dim()
, distinct()
, arrange()
, slice()
, separate()
and unite()
implemented for zoomed dm-s (#130).cdm_flatten_to_tbl()
(#147).slice.zoomed_dm()
: user decides in arg .keep_pk
if PK column is tracked or not (#152).enum_pk_candidates()
works with zoomed dm-s (#156).enum_fk_candidates()
(#156).cdm_insert_zoomed_tbl()
and cdm_add_tbl()
, defaulting to renaming of old and new tables when adding tables with duplicate names (#132).dm()
is akin to tibble()
, dm_from_src()
works like dm()
did previously, new_dm()
only accepts a list of tables and no longer validates, validate_dm()
checks internal consistency (#69).compute.dm()
applies filters and calls compute()
on all tables (#135).dm
(#100).zoomed_dm
(#131).cdm_select_tbl()
works again when multiple foreign keys are defined between two tables (#122).dm
. Zooming to a table vie cdm_zoom_to_tbl()
creates a zoomed dm
on which the {dplyr} verbs can be applied. The resulting table can be put back into the dm
with cdm_update_zoomed_tbl()
(overwriting the original table) or cdm_insert_zoomed_tbl()
(creating a new table), respectively (#89).cdm_select_to_tbl()
removes foreign key constraints if the corresponding columns are removed."dm"
using cdm_select_tbl()
(#108).dm
objects via dm()
and new_dm()
(#96).cdm_flatten_to_tbl()
now flattens all immediate neighbors by default (#95).cdm_add_tbl()
and cdm_rm_tbl()
(#90).cdm_get_con()
(#84).dm
object is defined using a nested tibble, one row per table (#57).cdm_enum_pk_candidates()
and cdm_enum_fk_candidates()
both show candidates first (#85).cdm_flatten_to_tbl()
works only in the immediate neighborhood (#75).cdm_squash_to_tbl()
implements recursive flattening for left, inner and full join (#75).cdm_check_constraints()
to check referential integrity of a dm
(#56).cdm_copy_to()
gains table_names
argument (#79).check_key()
now deals correctly with named column lists (#83).cdm_add_pk()
with a missing column.R CMD check
.cdm_enum_fk_candidates()
checks for class compatibility implicitly via left_join()
.cdm_enum_fk_candidates()
contains a more detailed entry in column why if no error & no candidate (percentage of mismatched vals etc.).cdm_join_to_tbl()
and cdm_flatten_to_tbl()
in the presence of cycles or disconnected tables (#74).src
component from dm (#38).cdm_get_src()
for local dm always returns a src based on .GlobalEnv
.cdm_flatten()
gains ...
argument to specify which tables to include. Currently, all tables must form a connected subtree rooted at start
. Disambiguation of column names now happens after selecting relevant tables. The resulting SQL query is more efficient for inner and outer joins if filtering is applied. Flattening with a right_join
with more than two tables is not well-defined and gives an error (#62).cdm_disambiguate_cols()
.cdm_flatten_to_tbl()
disambiguates only the necessary columns.enum_pk_candidates()
for character data.cdm_add_pk()
and cdm_add_fk()
no longer check data integrity by default.join
argument is a function, to avoid surprises when the caller passes data.cdm_copy_to()
works correctly with filtered dm
objects.cdm_apply_filters()
actually resets the filter conditions.cdm_draw()
no longer supports the table_names
argument, use cdm_select_tbl()
.dm
to a database now creates indexes for all primary and foreign keys.cdm_nrow()
returns named list (#49).cdm_semi_join()
.cdm_find_conn_tbls()
and the all_connected
argument to cdm_select()
(#35).cdm_set_key_constraints()
.cdm_select()
to cdm_select_tbl()
, now uses {tidyselect}.cdm_nycflights13()
now has cycle = FALSE
as default.cdm_check_for_*()
to cdm_enum_*()
.cdm_filter()
only records the filtering operation, the filter is applied only when querying a table via tbl()
or when calling compute()
or the new cdm_apply_filters()
(#32).cdm_flatten_to_tbl()
flattens a dm
to a wide table with starting from a specified table (#13). Rename cdm_join_tbl()
to cdm_join_to_tbl()
.cdm_disambiguate_cols()
(#40).cdm_rename()
(#41) and cdm_select()
(#50) for renaming and selecting columns of dm
tables.length.dm()
and length<-.dm()
(#53).$
, [[
, [
, names()
, str()
and length()
now implemented for dm objects (read-only).enum_pk_candidates()
.browse_docs()
opens the pkgdown website (#36).as_dm()
now also accepts a list of remote tables (#30).cdm_rename_tbl()
and cdm_select_tbl()
(#14).cdm_enum_fk_candidates()
and cdm_enum_pk_candidates()
contain a why
column that explains the reasons for rejection in a human-readable form (#12).create_graph_from_dm()
no longer fails in the presence of cycles (#10).cdm_filter()
no longer requires a primary key.decompose_table()
adds the new column in the table to the end.tbl()
now fails if the table is not part of the data model.nse_function()
replaces h()
for marking functions as NSE to avoid R CMD check warnings.NOT NULL
constraints are set at creation of the table. This removes the necessity to store column types.Initial GitHub release.
dm
objects and basic functions:dm()
new_dm()
validate_dm()
cdm_get_src()
cdm_get_tables()
cdm_get_data_model()
is_dm()
as_dm()
cdm_add_pk()
cdm_has_pk()
cdm_get_pk()
cdm_get_all_pks()
cdm_rm_pk()
cdm_check_for_pk_candidates()
cdm_add_fk()
cdm_has_fk()
cdm_get_fk()
cdm_get_all_fks()
cdm_rm_fk()
cdm_check_for_fk_candidates()
cdm_draw()
cdm_set_colors()
cdm_get_colors()
cdm_get_available_colors()
cdm_join_tbl()
cdm_filter()
cdm_semi_join()
cdm_nrow()
cdm_copy_to()
cdm_set_key_constraints()
cdm_learn_from_db()
cdm_is_referenced()
cdm_get_referencing_tables()
cdm_select()
cdm_find_conn_tbls()
decompose_table()
reunite_parent_child()
reunite_parent_child_from_list()
check_key()
check_if_subset()
check_set_equality()
check_cardinality_0_n()
check_cardinality_1_n()
check_cardinality_1_1()
check_cardinality_0_1()
cdm_nycflights13()
cdm_rename_table()
cdm_rename_tables()