# `dm_nest_tbl()` failure modes

    Code
      dm_nest_tbl(dm_for_filter(), tf_1)
    Condition
      Error in `dm_nest_tbl()`:
      ! "tf_1" can't be nested because it is not a terminal child table.
      children: "tf_2"

---

    Code
      dm_nest_tbl(dm_for_filter(), tf_2)
    Condition
      Error in `dm_nest_tbl()`:
      ! "tf_2" can't be nested because it is not a terminal child table.
      parents: "tf_1" and "tf_3"

---

    Code
      dm_nest_tbl(dm_for_filter(), tf_3)
    Condition
      Error in `dm_nest_tbl()`:
      ! "tf_3" can't be nested because it is not a terminal child table.
      children: "tf_2" and "tf_4"

---

    Code
      dm_nest_tbl(dm_for_filter(), tf_4)
    Condition
      Error in `dm_nest_tbl()`:
      ! "tf_4" can't be nested because it is not a terminal child table.
      parents: "tf_3"
      children: "tf_5"

# `dm_pack_tbl()`, `dm_unpack_tbl()`, `dm_nest_tbl()`, `dm_unnest_tbl()` work

    Code
      dm_packed <- dm_pack_tbl(dm_for_filter(), tf_1)
      dm_packed
    Output
      -- Metadata --------------------------------------------------------------------
      Tables: `tf_2`, `tf_3`, `tf_4`, `tf_5`, `tf_6`
      Columns: 19
      Primary keys: 5
      Foreign keys: 4
    Code
      dm_packed_nested <- dm_nest_tbl(dm_packed, tf_2)
      dm_packed_nested
    Output
      -- Metadata --------------------------------------------------------------------
      Tables: `tf_3`, `tf_4`, `tf_5`, `tf_6`
      Columns: 15
      Primary keys: 4
      Foreign keys: 3
    Code
      dm_packed_nested_unnested <- dm_unnest_tbl(dm_packed_nested, tf_3, tf_2, ptype = dm_for_filter())
      dm_packed_nested_unnested
    Output
      -- Metadata --------------------------------------------------------------------
      Tables: `tf_3`, `tf_4`, `tf_5`, `tf_6`, `tf_2`
      Columns: 19
      Primary keys: 5
      Foreign keys: 4
    Code
      dm_packed_nested_unnested_unpacked <- dm_unpack_tbl(dm_packed_nested_unnested,
        tf_2, tf_1, ptype = dm_for_filter())
      dm_packed_nested_unnested_unpacked
    Output
      -- Metadata --------------------------------------------------------------------
      Tables: `tf_3`, `tf_4`, `tf_5`, `tf_6`, `tf_2`, `tf_1`
      Columns: 20
      Primary keys: 6
      Foreign keys: 5

# `dm_pack_tbl()` failure modes

    Code
      dm_pack_tbl(dm_for_filter(), tf_2)
    Condition
      Error in `dm_pack_tbl()`:
      ! "tf_2" can't be packed because it is not a terminal parent table.
      parents : "tf_1" and "tf_3"

---

    Code
      dm_pack_tbl(dm_for_filter(), tf_3)
    Condition
      Error in `dm_pack_tbl()`:
      ! "tf_3" can't be packed because it is not a terminal parent table.
      children: "tf_2" and "tf_4"

---

    Code
      dm_pack_tbl(dm_for_filter(), tf_4)
    Condition
      Error in `dm_pack_tbl()`:
      ! "tf_4" can't be packed because it is not a terminal parent table.
      parents : "tf_3"
      children: "tf_5"

