exwiw 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2df915162dc88ac29ccc262c436d5d7ab1797a7e026398ced3e66d1e5b73a7b7
4
- data.tar.gz: 3144680abf12865a3db9d4173e4338101fa318da9f5e61e3367c5924fb24f9c6
3
+ metadata.gz: a93af3fb75c47b5f8e477716a595c3dd2909e23285c3c5838a965adf640d2db6
4
+ data.tar.gz: c98c7197342539af1faa5fce7c4acc759566cca3b96ea07585cc99e78a297572
5
5
  SHA512:
6
- metadata.gz: 2726b1b47c6584d6a85ab6f1342fdfb8ac760d237c09854f81a34e36d403a3720efbe25ee47185d3f381b4384e6a3f75f47ff6002fcbaa09d4613f937b39cc1f
7
- data.tar.gz: 75bb6c28ecd32adaa2aeb3488d319784811ad4ab08104560dea54982e94de51c7a7ff606b81815f6d73a41608f5f6dae49c57774a35ad837a8b6b5dab994c45d
6
+ metadata.gz: b7beec90b827baf014bbe16dcb6954374885ee40b2a3be13a17bb354cf51a88611d0dcfbe0273d00f987dc07032f61264d9cd160a9aac1fa5e2608cbceea0ee0
7
+ data.tar.gz: 41c69598a4564af9f6fad2108673101abb0a544f8f721032d9804d860caeaa440d0934b31c14038a988cc39cc98ef7594d5f8530ba7fcee76bdc0b4ab77f62cb
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.1.7] - 2026-10-01
6
+
7
+ ### Added
8
+
9
+ - **A narrowed table with a `belongs_to` to itself also keeps the ancestors of its rows.** A self-reference was ignored on every scoping path, so narrowing a tree table such as `categories` (`parent_id → categories.id`) to the categories a tenant's products point at dropped their parent categories and left `parent_id` dangling in the dump. The SQL adapters now wrap such a table's scope in a `WITH RECURSIVE` walk up every non-polymorphic self-reference, whichever path narrowed it. The ancestors are added regardless of the table's `filter` and scope, so where a tree spans tenants the dump includes the other tenant's ancestors. Tables that `belongs_to` the tree follow the rows including the ancestors, so the ancestors' own child rows are kept too — a table whose join route passes through the tree is narrowed by the route's first table's extraction query instead of being joined along it — and a table the tree points at includes the ancestors' references. A table dumped in full and a table extracted with `batch_scope` are unchanged (the latter with a pre-flight warning); the MongoDB adapter adds no ancestors and warns instead. Tables without a self-reference emit the same SQL as before. Requires MySQL 8.0+ for `WITH RECURSIVE`.
10
+
11
+ ## [1.1.6] - 2026-09-29
12
+
13
+ ### Added
14
+
15
+ - **`--target-table` can be omitted in scope-column mode.** Scope-column mode starts from every table that declares a `scope_column`, so the target only had to name one of them and was otherwise unused. `--ids` alone now runs in scope-column mode when any table in the schema declares a `scope_column` (tables marked `ignore: true` do not count), for both `export` and `explain`. When none does, the run stops before any output with an error saying to either name the table the ids belong to with `--target-table` (single-target mode) or declare a `scope_column` (scope-column mode). This check moved from the CLI to the schema pre-flight (`QueryAstBuilder.validate_scope!`), since it needs the schema. Runs that pass `--target-table`, and the deprecated `--scope-column` flag, behave as before. The mongodb adapter has no scope-column mode, so `--ids` there still requires `--target-collection` and is rejected by the CLI without it.
16
+ - **Scope-column mode can filter unrelated groups of tables by different kinds of id in one run.** A table can declare `id_space` next to its `scope_column` to say which ID space the column's values belong to, and `--ids` takes one value list per ID space: `--ids=1,2 --ids=org=<uuid>,<uuid>`. Tables without `id_space`, and `--ids` without a prefix, are the `default` ID space, so existing schemas, commands and configs keep their meaning. A table without a scope column is filtered by the ID space of the table it is scoped through. The config file's `ids:` also accepts a mapping (`ids: { default: [1, 2], org: [...] }`), and a shell after-insert hook receives each space given values as `EXWIW_IDS_<NAME>` (`EXWIW_IDS` stays the `default` space and is always set; Ruby hooks get `ids_for("<name>")`). The run aborts before extracting anything when a table's ID space was given no values, when a given ID space is used by no table, or when a table reaches scoped tables of more than one ID space, which the `belongs_to` walk would otherwise settle silently by picking the nearest. Single `--target-table` mode and the MongoDB adapter use only the `default` space and abort when a named one is given. See [Per-table `scope_column` and ID spaces](README.md#per-table-scope_column-and-id-spaces).
17
+
18
+ ### Changed
19
+
20
+ - **`--ids` is read as `<id_space>=<ids>` when the part before its first `=` looks like an ID space name** (a lowercase letter followed by lowercase letters, digits or underscores). An id list whose first id contains such a prefix, like `--ids=key=1`, now names the ID space `key`; pass `--ids=default=key=1` to keep it as an id. Giving `--ids` more than once for the same ID space is now an error instead of the last one silently winning.
21
+ - **`Exwiw::DumpTarget#ids` is a Hash from ID space name to values.** An Array passed to `DumpTarget.new(ids:)` is still accepted as the `default` space's values; read them with `#default_ids`.
22
+
5
23
  ## [1.1.5] - 2026-09-25
6
24
 
7
25
  ### Fixed