Skip to content

Releases: cynkra/dm

dm 1.1.1

07 Mar 00:54

Choose a tag to compare

Bug fixes

  • Fix igraph fallback to match igraph behavior for undirected edges and girth (#2424, #2425).

  • Remove spurious debugging output.

dm 1.1.0

27 Feb 00:56

Choose a tag to compare

Features

  • Aligned with dplyr 1.2.0, all new verbs and arguments are supported.

    dm_nycflights13() |>
      dm_zoom_to(flights) |>
      summarize(.by = origin, mean(dep_delay, na.rm = TRUE))
  • New dm_flatten() joins parent tables into a target table in-place and removes
    the now-integrated parents from the dm (#2393, #2394).
    Useful for denormalizing a star schema before reporting or further analysis.
    Supports recursive, allow_deep, and any dplyr join type.

    dm_nycflights13() |>
      dm_select_tbl(-weather) |>
      dm_flatten(flights, recursive = TRUE)
  • dm_draw() gains a backend_opts argument that collects all backend-specific
    options in a single named list (#2381).
    The individual top-level arguments (graph_attrs, node_attrs, edge_attrs,
    focus, graph_name, font_size, columnArrows) are soft-deprecated in
    favour of passing their equivalents in backend_opts.

    dm_nycflights13() |>
      dm_draw(backend_opts = list(column_arrow = FALSE))
  • dm_examine_constraints() gains a .max_value argument controlling how many
    distinct problematic values are reported in the problem column (#2200, #2387).
    The default is 6; use .max_value = Inf to report all violations.

    dm_nycflights13() |>
      dm_examine_constraints(.max_value = Inf)
  • check_key() now returns its input data frame when the key is valid
    (#2221, #2303), making it usable in pipelines.

    my_data |>
      check_key(id) |>
      dplyr::filter(value > 0)
  • igraph is now an optional dependency (#2146, #2364), reducing the mandatory
    install footprint.
    Functions that require igraph will prompt you to install it when needed.
    Set options(dm.use_igraph = FALSE) to turn off the startup message.

  • Keys are now learned automatically from SQLite databases (@gadenbuie, #352).

  • Improved duckplyr compatibility.

  • dm_pixarfilms() now bundles the pixarfilms data directly and gains a version
    argument (#2368, #2369).

  • All user-facing messages now use cli::cli_inform() with native formatting
    (#2374).

Breaking changes

  • A startup message now recommends running library(dplyr) before library(dm).
    In a future version, the dm package will no longer reexport all dplyr functions.
    The new pattern ensures that scripts written today will work after that change.
    Set options(dm.suppress_dplyr_startup_message = TRUE) to turn off the startup message.

    library(dplyr) # or library(tidyverse)
    library(dm)
  • copy_dm_to() now uses dm_sql() internally and creates key constraints on the
    database (@krlmlr, #1887, #2022).
    Unique keys and autoincrement primary keys (#1725) are set up automatically.
    Data models with cyclic foreign-key references are now supported on all databases
    that allow ALTER TABLE to add constraints (all except DuckDB and SQLite, #664).

    con <- DBI::dbConnect(duckdb::duckdb())
    dm_financial() |>
      copy_dm_to(con, ., temporary = FALSE, set_key_constraints = TRUE)
    DBI::dbDisconnect(con)

Bug fixes

  • dm_from_con(learn_keys = TRUE, .names = ) now correctly applies the specified
    table naming pattern (@owenjonesuob, #2213, #2214).

  • dm_from_con() no longer learns tables from all schemas by default for Postgres,
    MSSQL, and MariaDB (@mgirlich, #1440, #1448).
    The defaults are "public" (Postgres), "dbo" (MSSQL), and the current
    database (MariaDB), avoiding spurious system tables.

  • dm_rm_fk() no longer issues a spurious message when foreign keys reference
    non-primary-key columns (#1270, #2367).

  • dm_paste() limits its pipelines to up to 100 steps, splitting longer pipelines as needed (#2301).

dm 1.0.12

05 Jul 00:51

Choose a tag to compare

Bug fixes

  • Improve detection of foreign-key relationships in Postgres (#1879, #2286).

  • Avoid including constraints from a different constraint_schema when learning from a database (#2228, #2275).

Features

Chore

  • Remove fansi.

  • Suggest package used in demo.

  • Bump RMariaDB version (#2244).

  • Drop crayon and mockr dependencies (@olivroy, #2220).

Documentation

Testing

  • Stabilize learning tests (#2291).

  • Fix compatibility with waldo >= 0.6.0 (#2240).

dm 1.0.11

06 Dec 00:52

Choose a tag to compare

Features

Chore

Documentation

Testing

  • Fix compatibility with waldo >= 0.6.0 (#2240).

dm 1.0.10

23 Jan 01:22

Choose a tag to compare

Chore

  • Establish compatibility with igraph >= 2.0.0 (#2187) and withr 3.0.0 (#2184).

  • Reexport tibble::glimpse() instead of pillar::glimpse() to avoid pillar dependency with roxygen2 7.3.0 (#2179).

dm 1.0.9

10 Jan 01:21

Choose a tag to compare

Features

  • dm_sql() now processes table_names with dbplyr::escape(), therefore also accepting dbplyr objects (#2129).

Chore

dm 1.0.8

05 Nov 01:42

Choose a tag to compare

dm 1.0.8

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

  • Speed up dm(), new_dm(), as_dm() and dm_validate(). dm() and as_dm() no longer call dm_validate() (#2108).

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

27 Oct 07:26

Choose a tag to compare

Features

  • copy_dm_to() now warns unconditionally on unsupported arguments, and fails if copy_to is provided (#1944). Use the new dm_sql() function as a replacement for copy_dm_to(copy_to = ) (#1915, #2011, @jangorecki).

  • New json_unnest() and json_unpack(), currently implemented for data frames only (#991, #997).

  • dm_rows_append() also works for local dm, with support for autoincrement primary keys (#1727, #1745).

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

  • Test MySQL on GHA (#1940).

  • Improve MySQL compatibility regarding learning of database schemas and checking of constraints (#1938).

Breaking changes

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

Bug fixes

  • Compatibility with duckdb 0.9.1.

  • Minor fixes in dm_pack_tbl() and dm_unwrap_tbl() (#1947).

Documentation

  • Use rlang::check_installed() internally to install missing suggested packages on the fly (@olivroy, #1348, #2036, #2039, #2040).

  • Use vectorized rlang::is_installed()to decide if examples should be run (@olivroy, #2043).

  • Recategorize and describe function reference.

  • Better error and information messages when querying keys.

  • collect.zoomed_dm() shows a more helpful error message (#1929, #1945).

  • Add information on default font size to ?dm_draw (#1935).

  • Add db-* rules to Makefile to simplify Docker-based database setup.

  • Remove curly braces, add \pkg (@olivroy, #2042).

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

Internal

  • Prefer map*() over lapply() and vapply().

  • styler::style_pkg(scope = "tokens").

  • Rename internal new_dm3() to dm_from_def() (#1225, #1949).

  • Remove dead code (#979, #1950, #1871).

  • Reorganize build_copy_queries() (#1923).

  • Avoid dbplyr::ident_q() (#1788).

  • Add ellipsis to tbl_sum() signature (#1941).

dm 1.0.5

21 Mar 01:22

Choose a tag to compare

Features

  • Progress bars for dm_wrap_tbl() and dm_unwrap_tbl() (#835, #1450).

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

12 Feb 04:13

Choose a tag to compare

Features

  • dm_add_pk() gains autoincrement argument (#1689), autoincrement primary keys are configured on the database with copy_dm_to() (#1696).

  • New dm_add_uk(), dm_rm_uk() and dm_get_all_uks() functions for explicit support of unique keys (#622, #1716).

  • dm_get_all_pks() and dm_get_all_fks() return output in the order of table or parent_table argument (#1707).

  • Improve error message for dm_add_pk() when the columns argument is missing (#1644, #1646).

Breaking changes

  • dm_get_all_pks(), dm_get_all_fks(), and dm_get_all_uks() require unquoted table names as input, for consistency with other parts of the API (#1741).

Bug fixes

  • dm_examine_constraints() works for dm objects on the database with compound keys (#1713).

Documentation

Internal

  • Require dplyr >= 1.1.0 and lifecycle >= 1.0.3 (#1771, #1637).

  • Checks pass if all suggested packages are missing (#1659).

  • Fix r-devel builds (#1776).

  • dm_unpack_tbl() sets PK before FK (#1715).

  • Clean up dm_rows_append() implementation (#1714).

  • dm() accepts tables that are of class "tbl_sql" but not "tbl_dbi" (#1695, #1710).

  • Use correctly typed missing value for lists (@DavisVaughan, #1686).