Skip to contents

dm 1.0.10

CRAN release: 2024-01-21

Chore

dm 1.0.9

CRAN release: 2024-01-08

Features

Chore

dm 1.0.8

CRAN release: 2023-11-02

Bug fixes

  • copy_dm_to() creates string columns of necessary lengths for MariaDB and SQL Server. This worked before for SQL Server in dm 1.0.5, now also works on MariaDB (#311, #2066, #2082).

Features

  • Explicitly fail on compute(temporary = TRUE), which never worked correctly (#2059, #2103).

  • Warn about DuckDB not supporting autoincrementing primary keys (#2099).

Chore

  • Make check_suggested() a standalone (#2054).

Documentation

  • Tweak vignette for compute(temporary = TRUE).

  • Update documentation of check_suggested() (@olivroy, #2055).

Performance

Testing

  • Add test for copy_dm_to(table_names = ) (#250, #2101).

  • Work around test failures for dbplyr 2.4.0.

  • Remove most skips from tests (#2052).

dm 1.0.7

CRAN release: 2023-10-24

Features

Breaking changes

  • Breaking change: Add check_dots_empty() calls (#1929, #1943).

Bug fixes

Documentation

Performance

Testing

  • Remove most skips from tests (#2052).

  • Add explicit unique key to dm_for_filter().

  • Add Postgres test for dm_sql().

  • Switch internal testing to MariaDB.

  • Fast offline checks with new "DM_OFFLINE" environment variable.

  • New GHA checks for the case of missing suggested packages (#1952).

Chore

  • Make check_suggested() a standalone (#2054).

  • Backport changes from attempted CRAN release (#2046).

  • Move magrittr (#1975, #1983), DBI (#1974), and pillar (#1976) to "Suggests".

  • Require RMariaDB 1.3.0, work around tidyverse/dbplyr#1190 and tidyverse/dbplyr#1195 (#1989).

Internal

dm 1.0.6

CRAN release: 2023-07-21

Bug fixes

  • Compare version returned by getRversion() with string instead of number.

  • Work around vctrs bug in jsonlite 1.8.5.

Features

Chore

Documentation

  • Add table description to diagram in README.

  • Tweak testing instructions. Mention Makefile in CONTRIBUTING.md. Describe Docker setup (#1898).

  • Vignette corrections (@MikeJohnPage, #1882).

  • Avoid tidyverse package.

Testing

  • Fix local tests (#1921).

dm 1.0.5

CRAN release: 2023-03-16

Features

Documentation

  • Add cheat sheet as a vignette (#1653).

  • Suggest creating a function for your database dm object (#1827, #1828).

  • Add alternative text to author images for pkgdown website (#1804).

Chore

  • Compatibility with dev jsonlite (#1837).

  • Remove tidyverse dependency (#1798, #1834).

  • Minimal patch to fix multiple match updates (@DavisVaughan, #1806).

  • Adapt to rlang 1.1.0 changes (#1817).

  • Make sure dm passes “noSuggests” workflow (#1659).

dm 1.0.4

CRAN release: 2023-02-11

Features

Breaking changes

Bug fixes

Documentation

Internal

dm 1.0.3

CRAN release: 2022-10-12

Chore

  • Avoid running example without database connection.

dm 1.0.2

CRAN release: 2022-09-20

Features

Bug fixes

Chore

dm 1.0.1

CRAN release: 2022-08-06

Features

  • New dm_deconstruct() creates code to deconstruct a dm object into individual keyed tables via pull_tbl(keyed = TRUE) (#1354).

Bug fixes

dm 1.0.0

CRAN release: 2022-07-21

Features

Breaking changes

API

Performance

Bug fixes

Documentation

Internal

  • Use sensible node and edge IDs, corresponding to the data model, in SVG graph (#1214).

  • Tests for datamodelr code (#1215).

dm 0.3.0

CRAN release: 2022-07-06

Features

API

Bug fixes

  • Compatibility fix for writing to SQL Server tables with dbplyr >= 2.2.0.

Documentation

Internal

  • Switch to duckdb as default database backend (#1179).

  • Test duckdb and MariaDB on GHA (#1091, #1136).

dm 0.2.8

CRAN release: 2022-04-08

Features

  • pack_join() works correctly if name is the same as an existing column in either table. In some cases a column is overwritten, this is consistent with nest_join() behavior (#864, #865).
  • Messages that suggest the installation of optional packages are shown only once per session (#852).
  • dm_insert_zoomed() uses the color from the zoomed table for the new table (#750, #863).
  • copy_dm_to() consumes less memory and is faster when writing to SQL Server (#855).

Bug fixes

  • Remove extra spaces in output when examining constraints with compound keys (#868).
  • Fix column tracking for foreign keys (#856, #857).
  • copy_dm_to() shows progress bars again (#850, #855).
  • Progress bars use the console width (#853).
  • Avoid calling dbAppendTable() for zero-row tables (#847).

Internal

  • Require rlang 1.0.1 (#840).

dm 0.2.7

CRAN release: 2022-02-03

Features

Bug fixes

  • db_schema_...() functions no longer pro-actively check for schema existence (#672, #815, #771).
  • db_schema_list.Microsoft SQL Server no longer ignoring schemas for which the owner cannot be found (#815, #771).
  • copy_dm_to() works with DuckDB again, the SQL statements to define the tables and indexes are now created by us (#701, #709).

Internal

  • Establish compatibility with rlang 1.0.0 (#756).
  • Simplify database checks on GitHub Actions (#712).

dm 0.2.6

CRAN release: 2021-11-21

Features

Bug fixes

Internal

  • Fix compatibility with dplyr 1.0.8 (#698).

dm 0.2.5

CRAN release: 2021-10-15

Features

  • mutate(), transmute(), distinct() and summarize() now support dplyr::across() and extra arguments (#640).
  • Key tracking for the first three verbs is less strict and based on name equality (#663).
  • relocate() now works on zoomed dm objects (#666).
  • dm_add_fk() gains on_delete argument which copy_dm_to() picks up and translates to an ON DELETE CASCADE or ON DELETE NO ACTION specification for the foreign key (#649).
  • dm_copy_to() defines foreign keys during table creation, for all databases except DuckDB. Tables are created in topological order (#658). For cyclic relationship graphs, table creation is attempted in the original order and may fail (#664).
  • waldo::compare() shows better output for dm objects (#642).
  • dm_paste() output uses trailing commas in the dm::dm() and tibble::tibble() calls, and sorts column attributes by name, for better modularity (#641).

Breaking changes

Bug fixes

  • copy_dm_to() and sql_create_schema() no longer actively check for schema existence (#644, #660).
  • Add newline after OUTPUT clause for SQL Server (#647).
  • Fix sql_rows_delete() with returning argument for SQL Server (#645).

Internal

  • Remove method only needed for RSQLite < 2.2.8, add warning if loaded RSQLite version is <= 2.2.8 (#632).
  • Adapt MSSQL tests to testthat update (#648).

dm 0.2.4

CRAN release: 2021-09-30

Features

Bug fixes

Internal

dm 0.2.3

CRAN release: 2021-06-20

Bug fixes

Features

Internal

  • Skip examples that might require internet access on non-CI platforms.

dm 0.2.2

CRAN release: 2021-06-13

Features

Internal

  • Always run database tests on sqlite for df source.
  • Establish compatibility with testthat > 3.0.2 (#566, @moodymudskipper).

dm 0.2.1

CRAN release: 2021-05-11

Breaking changes

Features

  • dm_add_fk() gains ref_columns argument that supports creating foreign keys to non-primary keys (#402).
  • dm_get_all_pks() gains table argument for filtering the returned primary keys (#560).
  • dm_get_all_fks() gains parent_table argument for filtering the returned foreign keys (#560).
  • dm_rm_fk() gains an optional ref_columns argument. This function now supports removal of multiple foreign keys filtered by parent or child table or columns, with a message (#559).
  • dm_rm_pk() gains columns argument and allows filtering by columns and by tables or removing all primary keys. The rm_referencing_fks argument has been deprecated in favor of the new fail_fk argument (#558).
  • dm_get_all_fks() has been optimized for speed and no longer sorts the keys (#560).
  • dm operations are now slightly faster overall.

Internal

  • The internal data structure for a dm object has changed to accommodate foreign keys to other columns than the primary key. An upgrade message is shown when working with a dm object from an earlier version, e.g. if it was loaded from a cache or an .rds file (#402).
  • Drop "dm_v1" class from dm objects again, this would have made every S3 dispatch more costly. Relying on an internal "version" attribute instead (#547).

dm 0.2.0

CRAN release: 2021-05-03

Breaking changes

  • Deprecate dm_get_src() tbl.dm(), src_tbls.dm(), copy_to.dm(). These functions have better alternatives and use the notion of a “data source” which is being phased out of dplyr (#527).
  • *_pk() and *_fk() functions gain an ellipsis argument that comes before check, force and rm_referencing_fks arguments (#520).

Features

  • dm_add_pk() and dm_add_fk() support compound keys via the c() notation, e.g. dm_add_pk(dm, table, c(col1, col2)). dm_nycflights13() returns a data model with compound keys by default. Use compound = FALSE to return the data model from dm v0.1.13 or earlier (#3).
  • dm_get_all_fks() includes parent_pk_cols column that describes the primary key columns of the parent table (#335).
  • dm_from_src() supports the schema argument also for MariaDB and MySQL databases (#516).
  • dm objects now inherit from "dm_v1" in addition to "dm", to allow backward-compatible changes of the internal format (#521).
  • Use hack to create compound primary keys on the database (#522).
  • dm_examine_constraints() and other check functions count the number of rows that violate constraints for primary and foreign keys (#335).
  • copy_dm_to(set_key_constraints = FALSE) downgrades unique indexes to regular indexes (#335).
  • rows_truncate() implemented for data frames (#335).
  • dm_enum_fk_candidates() enumerates column in the order they apper in the table (#335).

dm 0.1.13

CRAN release: 2021-04-25

Features

Bug fixes

Performance

  • enum_fk_candidates() now only checks distinct values, this improves performance for large tables. As a consequence, only the number of distinct values is reported for mismatches, not the number of mismatching rows/entries (#494).

Documentation

Internal

dm 0.1.12

CRAN release: 2021-02-15

dm 0.1.10

CRAN release: 2021-01-07

  • Columns with missing values are no longer primary keys (#469).
  • Fix dm_from_src() for MSSQL when learn_keys = FALSE (#427).
  • Tests use expect_snapshot() everywhere (#456).
  • Fix compatibility with testthat 3.0.1 (#457).

dm 0.1.9

CRAN release: 2020-11-18

dm 0.1.7

CRAN release: 2020-09-02

  • Bump RMariaDB required version to 1.0.10 to work around timeout with R CMD check.
  • dm_from_src() accepts schema argument for MSSQL databases (#367).

dm 0.1.6

CRAN release: 2020-07-29

Breaking changes

Features

  • 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.
  • Error messages now refer to “tables”, not “elements” (#413).
  • New dm_bind() for binding two or more ‘dm’ objects together (#417).

Bug fixes

  • For databases, the underlying SQL table names are quoted early to avoid later SQL syntax errors (#419).
  • 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.

Internal

dm 0.1.5

CRAN release: 2020-07-03

Features

  • dm_paste() generates self-contained code (#401).
  • Errors regarding cycles in the relationship graph now show the shortest cycle (#405).
  • Implement rows_truncate() for databases.
  • collect() works on a zoomed dm, with a message.
  • The data model is drawn in a more compact way if it comprises of multiple connected components.
  • dm_add_pk(check = TRUE) gives a better error message.

Bug fixes

  • rows_insert() works if column names consist of SQL keywords (#409).
  • Cycles in other connected components don’t affect filtering in a cycle-free component.
  • Avoid src_sqlite() in examples (#372).

Internal

  • Testing SQLite, Postgres and SQL Server on GitHub Actions (#408, @pat-s).
  • Testing packages with all “Suggests” uninstalled.

dm 0.1.4

CRAN release: 2020-06-07

Features

Documentation

Internal

  • Require dplyr >= 1.0.0.

  • Use GitHub Actions (#369, @pat-s).

dm 0.1.3

CRAN release: 2020-05-25

  • Avoid src_sqlite() in vignettes (#372).
  • Rename vignettes (#349).
  • Rename error class "dm_error_tables_not_neighbours" to "dm_error_tables_not_neighbors".
  • Shortened README and intro article (#192, @jawond).
  • Better testing for MSSQL (#339).
  • Fix compatibility with dplyr 1.0.0.

dm 0.1.2

CRAN release: 2020-05-04

Features

Bug fixes

  • Fix visualization of column that acts as a foreign key more than once (#37).
  • 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 "dm_zoomed" (#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.dm_zoomed() no longer throws an error.
  • Remove unused DT import (#295).

Compatibility

  • Remove use of deprecated src_df() (#336).
  • Fix compatibility with dplyr 1.0.0 (#203).

Documentation

Internal

  • Testing on local data frames (by default), optionally also SQLite, Postgres, RMariaDB, and SQL Server. Currently requires development versions and various pull requests (#334, #327, #312, #76).
  • dm_nycflights13(subset = TRUE) memoizes subset and also reduces the size of the weather table.
  • Expand definitions of deprecated functions (#204).

dm 0.1.1

CRAN release: 2020-03-12

  • Implement format.dm().
  • Adapt to tidyselect 1.0.0 (#257).
  • Zooming and unzooming is now faster if no columns are removed.
  • Table names must be unique.
  • dm_examine_constraints() formats the problems nicely.
  • New class for prettier printing of keys (#244).
  • Add experimental schema support for dm_from_src() for Postgres through the new schema and table_type arguments (#256).

dm 0.1.0

dm 0.0.6

dm 0.0.5

Features

Documentation

  • New demo.
  • Add explanation for empty dm (#100).

Bug fixes

  • Avoid asterisk when printing local dm_zoomed (#131).
  • cdm_select_tbl() works again when multiple foreign keys are defined between two tables (#122).

dm 0.0.4

dm 0.0.3

dm 0.0.2.9003

  • Fix R CMD check.

dm 0.0.2.9002

dm 0.0.2.9001

  • Remove the src component from dm (#38).
  • Internal: Add function checking if all tables have same src.
  • Internal: Add 2 classed errors.
  • 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).
  • Add a vignette for joining functions (#60, @cutterkom).
  • Shorten message in cdm_disambiguate_cols().

dm 0.0.2.9000

  • cdm_flatten_to_tbl() disambiguates only the necessary columns.
  • When flattening, the column name of the LHS (child) table is used (#52).
  • Fix formatting in enum_pk_candidates() for character data.
  • cdm_add_pk() and cdm_add_fk() no longer check data integrity by default.
  • Explicitly checking that the 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.
  • A more detailed README file and a vignette for filtering (#29, @cutterkom).
  • cdm_draw() no longer supports the table_names argument, use cdm_select_tbl().
  • Copying a dm to a database now creates indexes for all primary and foreign keys.

dm 0.0.2

Breaking changes

Performance

New functions

Minor changes

Documentation

  • Add setup article (#7).

Internal

  • Using simpler internal data structure to store primary and foreign key relations (#26).
  • New nse_function() replaces h() for marking functions as NSE to avoid R CMD check warnings.
  • Simplified internal data structure so that creation of new operations that update a dm becomes easier.
  • When copying a dm to a database, NOT NULL constraints are set at creation of the table. This removes the necessity to store column types.
  • Using {RPostgres} instead of {RPostgreSQL} for testing.

dm 0.0.1

Initial GitHub release.

Creating dm objects and basic functions:

Primary keys

Foreign keys

Flattening

  • cdm_join_tbl()

Filtering

Interaction with DBs

Utilizing foreign key relations

Miscellaneous