pipework 0.243.0 → 0.246.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/REFERENCE.md +16 -472
  3. package/dist/core/config/namespace.d.ts +1 -0
  4. package/dist/core/config/namespace.d.ts.map +1 -1
  5. package/dist/core/config/schema.d.ts +2 -0
  6. package/dist/core/config/schema.d.ts.map +1 -1
  7. package/dist/core/config/schema.js +1 -0
  8. package/dist/core/config/schema.js.map +1 -1
  9. package/dist/data/migrate/diff.js +4 -0
  10. package/dist/data/migrate/diff.js.map +1 -1
  11. package/dist/data/migrate/snapshot.d.ts +2 -0
  12. package/dist/data/migrate/snapshot.d.ts.map +1 -1
  13. package/dist/data/migrate/snapshot.js +1 -0
  14. package/dist/data/migrate/snapshot.js.map +1 -1
  15. package/dist/data/migrate/sql-emit.js +5 -1
  16. package/dist/data/migrate/sql-emit.js.map +1 -1
  17. package/dist/data/query/pg-core/indexes.d.ts +5 -0
  18. package/dist/data/query/pg-core/indexes.d.ts.map +1 -1
  19. package/dist/data/query/pg-core/indexes.js +4 -0
  20. package/dist/data/query/pg-core/indexes.js.map +1 -1
  21. package/dist/infra/alerts/handle.d.ts.map +1 -1
  22. package/dist/infra/alerts/handle.js +11 -10
  23. package/dist/infra/alerts/handle.js.map +1 -1
  24. package/dist/infra/email/sigv4.d.ts +24 -0
  25. package/dist/infra/email/sigv4.d.ts.map +1 -0
  26. package/dist/infra/email/sigv4.js +55 -0
  27. package/dist/infra/email/sigv4.js.map +1 -0
  28. package/dist/test/auto-setup.js +2 -2
  29. package/dist/test/auto-setup.js.map +1 -1
  30. package/dist/test/index.d.ts +1 -0
  31. package/dist/test/index.d.ts.map +1 -1
  32. package/dist/test/index.js +1 -0
  33. package/dist/test/index.js.map +1 -1
  34. package/dist/test/plugin.d.ts +6 -1
  35. package/dist/test/plugin.d.ts.map +1 -1
  36. package/dist/test/plugin.js +12 -1
  37. package/dist/test/plugin.js.map +1 -1
  38. package/dist/test/reset.d.ts +35 -0
  39. package/dist/test/reset.d.ts.map +1 -0
  40. package/dist/test/reset.js +179 -0
  41. package/dist/test/reset.js.map +1 -0
  42. package/dist/test/setup.d.ts.map +1 -1
  43. package/dist/test/setup.js +78 -5
  44. package/dist/test/setup.js.map +1 -1
  45. package/dist/test/vitest.js +2 -2
  46. package/dist/test/vitest.js.map +1 -1
  47. package/dist/test/watch.d.ts +21 -0
  48. package/dist/test/watch.d.ts.map +1 -0
  49. package/dist/test/watch.js +81 -0
  50. package/dist/test/watch.js.map +1 -0
  51. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.246.0
4
+
5
+ - **Added: covering indexes, `idx.index(name).on(...).include(...columns)` and the same on `idx.uniqueIndex`** (#879). The included columns are stored in the index snapshot and emitted as `INCLUDE (...)` after the key columns, so a lookup that reads only key and included columns can be an index-only scan. Adding, dropping or reordering included columns on an existing index migrates as an online replace (build `<name>_new` `CONCURRENTLY`, drop the old one `CONCURRENTLY`, rename). Indexes without `include` diff as before.
6
+
7
+ ## 0.245.0
8
+
9
+ - **Added: a test about to time out says what its database connection is doing** (#874). At 2/3 of a test's timeout (its own `timeout`, else `testTimeout`), the harness writes one `pipework:test-watch` line (`console.warn`) naming the test; each backend on its test database(s) with state, wait event, seconds in state, `pg_blocking_pids` and the query (200 chars); and the host's `/proc/loadavg` and `/proc/pressure/{io,cpu}` where present. An `active` backend waiting on IO or a lock says Postgres or the disk stalled; `idle in transaction` on `ClientRead` says the test's own process did. It samples over its own short-lived admin connection, bounded at 5 s, and never fails or delays the test; a test that finishes first prints nothing. `TEST_WATCH_LOG_PREFIX` and `armTestWatch` are exported from `pipework/test`.
10
+ - **Fixed: concurrent `alerts.raise` of one key could report a grouped raise as `resent` and queue a second delivery** (#875). Raises take their timestamp before waiting on the row lock, and "sent" was read from `last_sent_at = last_seen_at`, so two backends in the same microsecond tied. A raise now counts as sent only when its statement set `last_sent_at`, and `last_seen_at` never moves backwards.
11
+
12
+ ## 0.244.0
13
+
14
+ - **Changed: a test process keeps its database across files instead of cloning and dropping one per file** (#870). The first file a vitest worker runs clones the template as before; when the file ends, the database is kept, and the next file in that worker gets it back reset to its state right after the clone: every table that grew is cleared, tables that had rows are reloaded, sequences restored. The reset checks a digest of the schema (tables, columns and types, constraints, indexes, policies, enums, partitions, functions and triggers, grants, database settings) and clones fresh instead when a file changed what a reset cannot undo (schema, settings, a prepared transaction, a refreshed materialized view); `pipework:test-reset` log lines name the reason. Reuse happens wherever a vitest worker process runs more than one file. Without a superuser the reload runs without `session_replication_role = replica`. **Opt out:** `test: { databasePerFile: true }` restores a clone and a queued drop per file.
15
+ - **Changed: `docker-compose.test.yml` keeps the test cluster in memory and small** (#869): `wal_level=minimal` with `wal_skip_threshold=0` and `max_wal_senders=0` (no replication WAL; a table created in a transaction is not WAL-logged), `max_wal_size=256MB`, `checkpoint_timeout=30min`, `autovacuum=off`. Recreate the container to pick it up.
16
+
3
17
  ## 0.243.0
4
18
 
5
19
  - **Fixed: test setup failed with "No progress" while a long migration file was still applying** (#871). The template build reported progress only after each migration file committed, so a file whose statements together ran past `test.setupStallMs` on a loaded box (verity: 120+ s at `template-migrate`) failed the run. Setup now beats after every statement of a file (`template-migrate` detail `i/n <tag> stmt s/n`), before the first file (`start`, then `prepare <step>` for the tracker table, legacy tag recovery per file, the tag index and the applied read), and on each template-build step (`drop`, `create`, `owner`, `platform role`) and framework table statement. A single statement that hangs still trips the watchdog; its thresholds are unchanged. `applyMigrations` takes `onStatement(tag, statement, statements, index, total)` and `onPrepare(detail)`.