@ultimat3/cli 31.8.0 → 31.9.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.
- package/package.json +29 -29
- package/wiki/Entities-And-Migrations.md +134 -5
- package/wiki/Upgrading.md +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/cli",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.9.0",
|
|
4
4
|
"description": "The `x` binary: new, dev, build, verify, generate, db, mcp, doctor, deploy",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -53,34 +53,34 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/core": "^8.0.9",
|
|
56
|
-
"@ultimat3/action": "31.
|
|
57
|
-
"@ultimat3/admin": "31.
|
|
58
|
-
"@ultimat3/ai": "31.
|
|
59
|
-
"@ultimat3/auth": "31.
|
|
60
|
-
"@ultimat3/cache": "31.
|
|
61
|
-
"@ultimat3/core": "31.
|
|
62
|
-
"@ultimat3/db": "31.
|
|
63
|
-
"@ultimat3/entity": "31.
|
|
64
|
-
"@ultimat3/flags": "31.
|
|
65
|
-
"@ultimat3/http": "31.
|
|
66
|
-
"@ultimat3/i18n": "31.
|
|
67
|
-
"@ultimat3/jobs": "31.
|
|
68
|
-
"@ultimat3/mail": "31.
|
|
69
|
-
"@ultimat3/manifest": "31.
|
|
70
|
-
"@ultimat3/mcp": "31.
|
|
71
|
-
"@ultimat3/money": "31.
|
|
72
|
-
"@ultimat3/notify": "31.
|
|
73
|
-
"@ultimat3/policy": "31.
|
|
74
|
-
"@ultimat3/pwa": "31.
|
|
75
|
-
"@ultimat3/query": "31.
|
|
76
|
-
"@ultimat3/realtime": "31.
|
|
77
|
-
"@ultimat3/render": "31.
|
|
78
|
-
"@ultimat3/schema": "31.
|
|
79
|
-
"@ultimat3/scraping": "31.
|
|
80
|
-
"@ultimat3/seo": "31.
|
|
81
|
-
"@ultimat3/storage": "31.
|
|
82
|
-
"@ultimat3/testing": "31.
|
|
83
|
-
"@ultimat3/time": "31.
|
|
56
|
+
"@ultimat3/action": "31.9.0",
|
|
57
|
+
"@ultimat3/admin": "31.9.0",
|
|
58
|
+
"@ultimat3/ai": "31.9.0",
|
|
59
|
+
"@ultimat3/auth": "31.9.0",
|
|
60
|
+
"@ultimat3/cache": "31.9.0",
|
|
61
|
+
"@ultimat3/core": "31.9.0",
|
|
62
|
+
"@ultimat3/db": "31.9.0",
|
|
63
|
+
"@ultimat3/entity": "31.9.0",
|
|
64
|
+
"@ultimat3/flags": "31.9.0",
|
|
65
|
+
"@ultimat3/http": "31.9.0",
|
|
66
|
+
"@ultimat3/i18n": "31.9.0",
|
|
67
|
+
"@ultimat3/jobs": "31.9.0",
|
|
68
|
+
"@ultimat3/mail": "31.9.0",
|
|
69
|
+
"@ultimat3/manifest": "31.9.0",
|
|
70
|
+
"@ultimat3/mcp": "31.9.0",
|
|
71
|
+
"@ultimat3/money": "31.9.0",
|
|
72
|
+
"@ultimat3/notify": "31.9.0",
|
|
73
|
+
"@ultimat3/policy": "31.9.0",
|
|
74
|
+
"@ultimat3/pwa": "31.9.0",
|
|
75
|
+
"@ultimat3/query": "31.9.0",
|
|
76
|
+
"@ultimat3/realtime": "31.9.0",
|
|
77
|
+
"@ultimat3/render": "31.9.0",
|
|
78
|
+
"@ultimat3/schema": "31.9.0",
|
|
79
|
+
"@ultimat3/scraping": "31.9.0",
|
|
80
|
+
"@ultimat3/seo": "31.9.0",
|
|
81
|
+
"@ultimat3/storage": "31.9.0",
|
|
82
|
+
"@ultimat3/testing": "31.9.0",
|
|
83
|
+
"@ultimat3/time": "31.9.0",
|
|
84
84
|
"babel-preset-solid": "^1.9.16"
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -310,7 +310,7 @@ export const db = database(entities, { driver });
|
|
|
310
310
|
| paging — `.limit(n)`, then `.after(cursor).page()`; a raw join pages with `keyset()` from `@ultimat3/db` ([below](#paging-a-raw-join)) | an offset, or a paging module |
|
|
311
311
|
| the transaction — inside `withTransaction` the handle is the transaction, and a statement on it after the scope ended is `X_DB_TRANSACTION_CLOSED`: `await` it, or `outsideTransaction(fn)` for work that must outlive the scope | a client argument |
|
|
312
312
|
| locks — `db.posts.lock(id, fn)` for a row, `db.posts.lockKey(key, fn)` for a key, both under the tenant | `for update` by hand, or an advisory lock |
|
|
313
|
-
| abandonment — once `ctx.signal` is aborted with a coded reason (`X_TIMEOUT`, a job's cancellation) a write rethrows that reason: a transaction rolls back and neither driver writes. A client hang-up is not a refusal. `runToCompletion(fn)` for work that must land | a check of the signal before each write |
|
|
313
|
+
| abandonment — once `ctx.signal` is aborted with a coded reason (`X_TIMEOUT`, a job's cancellation) a write rethrows that reason: a transaction rolls back and neither driver writes. A client hang-up is not a refusal. `runToCompletion(fn)` for work that must land. A pooled Postgres read in flight when `ctx.signal` aborts is cancelled on the server and throws `X_ABORTED` (`packages/db/src/statement-cancel.ts`, pinned by `pg-read-cancel.live.test.ts`); a read sent after the abort, or inside a transaction, runs — cleanup in a `finally` still reads. `As of 2026-11` | a check of the signal before each write |
|
|
314
314
|
|
|
315
315
|
| Raw `sql` | Where |
|
|
316
316
|
|---|---|
|
|
@@ -494,6 +494,21 @@ await db.checkpoints.update(id, { cursor: batches.cursor }); // resume with .a
|
|
|
494
494
|
| Unsortable kinds | `orderBy` on a `json`, `bytes` or array column is refused at plan time, at any row count (`X_INVARIANT_VIOLATED`). It paged wrongly or threw past page 1. Order by a scalar |
|
|
495
495
|
| Patches | `update`, `updateWhere` validate named columns, with `insert`'s issues, before the statement, on both drivers. Absent stays absent, `null` clears a nullable column |
|
|
496
496
|
| Tenancy | the plan's, as everywhere else: an unscoped chain is `X_TENANCY_UNSCOPED` on its first batch |
|
|
497
|
+
| Heavy rows | a batch past the [page byte bound](#a-page-is-bounded-in-bytes) is re-read from the same cursor at half the rows, down to one, and the smaller size is kept for the batches after it (`batch-bytes.ts`): a sweep over heavy rows finishes. At most `⌈log2(size)⌉` refused statements per batch; one row over the bound on its own is still `X_ENTITY_PAGE_TOO_LARGE`. `As of 2026-11` |
|
|
498
|
+
|
|
499
|
+
### A page is bounded in bytes
|
|
500
|
+
|
|
501
|
+
`MAX_PAGE_SIZE` bounds rows; `MAX_PAGE_BYTES` (64 MiB, exported) bounds what they weigh, measured on
|
|
502
|
+
the raw rows before one is decoded. Past it the read is `X_ENTITY_PAGE_TOO_LARGE` (500), never a
|
|
503
|
+
truncated page. `As of 2026-11`:
|
|
504
|
+
|
|
505
|
+
| Property | Behavior |
|
|
506
|
+
|---|---|
|
|
507
|
+
| Where | every `findMany`: `page()`, `all()`, `one()`, a batch. Postgres weighs the page it answered (`pg-driver.ts`), memory and a `defineDriver` store the projected page — so a test against memory refuses the page production would |
|
|
508
|
+
| Weight | a string by its length, binary by `byteLength`, 8 per scalar or `Date`, a parsed `jsonb` walked; counting stops at the bound |
|
|
509
|
+
| The `fix:` | names the heaviest column and pastes onto the read: `.select({ id: true, title: true }).limit(n)` — every column but that one, and the row count that fits |
|
|
510
|
+
| A constant | no per-call or per-driver option. As of 2026-11 the heaviest page in both tracked apps' suites is 16,560 B (120 `users` rows), about 4,000× under the bound |
|
|
511
|
+
| Cost | as of 2026-11, Bun 1.4.4: 3–4 µs per 51-row page of flat columns, 11–12 µs with a small `jsonb` per row |
|
|
497
512
|
|
|
498
513
|
## A count per row is one grouped count
|
|
499
514
|
|
|
@@ -594,8 +609,122 @@ already stored is skipped and absent, which is how a caller counts what it actua
|
|
|
594
609
|
| Nulls | a null in the conflict target collides with nothing, in both drivers — a Postgres unique index is `NULLS DISTINCT` |
|
|
595
610
|
| Size | past 65535 bind parameters the batch is several statements inside one transaction (a savepoint inside an open `withTransaction`), never one the server refuses. A failure in any chunk leaves no row of the batch, in both drivers; one chunk stays one autocommit statement, no `BEGIN`. Partial progress is yours to ask for: split the batch and call once per part |
|
|
596
611
|
|
|
597
|
-
|
|
598
|
-
|
|
612
|
+
### A count instead of the rows
|
|
613
|
+
|
|
614
|
+
`{ returning: false }` on `insertAll` or `upsertAll` resolves with how many rows were written: no
|
|
615
|
+
`returning *`, nothing decoded. The same chunks, judging and atomicity as the returning form.
|
|
616
|
+
`As of 2026-11`:
|
|
617
|
+
|
|
618
|
+
```ts
|
|
619
|
+
import { database, entity, integer, text, uuid } from '@ultimat3/entity';
|
|
620
|
+
|
|
621
|
+
const events = entity('events', {
|
|
622
|
+
columns: { id: uuid().primaryKey(), orgId: uuid().tenant(), name: text({ max: 80 }) },
|
|
623
|
+
});
|
|
624
|
+
const counters = entity('counters', {
|
|
625
|
+
columns: {
|
|
626
|
+
id: uuid().primaryKey(),
|
|
627
|
+
orgId: uuid().tenant(),
|
|
628
|
+
day: text({ max: 10 }),
|
|
629
|
+
total: integer(),
|
|
630
|
+
},
|
|
631
|
+
indexes: [{ on: ['orgId', 'day'], unique: true }],
|
|
632
|
+
});
|
|
633
|
+
const db = database({ events, counters });
|
|
634
|
+
|
|
635
|
+
export const record = async (orgId: string, names: readonly string[]): Promise<number> =>
|
|
636
|
+
db.events.insertAll(
|
|
637
|
+
names.map((name) => ({ orgId, name })),
|
|
638
|
+
{ returning: false },
|
|
639
|
+
);
|
|
640
|
+
|
|
641
|
+
export const tally = async (orgId: string, days: readonly string[]): Promise<number> =>
|
|
642
|
+
db.counters.upsertAll(
|
|
643
|
+
days.map((day) => ({ orgId, day, total: 1 })),
|
|
644
|
+
{ onConflict: ['orgId', 'day'], returning: false },
|
|
645
|
+
);
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
While an external search index or an `entity.row` subscriber needs the rows, the count form runs as
|
|
649
|
+
its returning counterpart and still resolves with the count.
|
|
650
|
+
|
|
651
|
+
### A bulk load is `copyAll`
|
|
652
|
+
|
|
653
|
+
`db.<table>.copyAll(rows)` sends one `COPY … FROM STDIN`: all or nothing, resolves with the count.
|
|
654
|
+
Rows are parsed, sealed, tenant-checked and judged exactly as `insertAll` judges them. `As of 2026-11`:
|
|
655
|
+
|
|
656
|
+
| Property | Behavior |
|
|
657
|
+
|---|---|
|
|
658
|
+
| Columns | every row names the same columns, else `X_INVARIANT_VIOLATED`: COPY has one column list and no per-row `default` cell. Refused on every driver |
|
|
659
|
+
| Collisions | none handled: a duplicate refuses the whole load. `upsertAll` is the call that tolerates one |
|
|
660
|
+
| Where it is COPY | `postgresDriver()`, on a client with `copyIn` (`canCopyIn`, `@ultimat3/db`). Inside `withTransaction` it is that transaction's; under the replica router, the primary's |
|
|
661
|
+
| Where it is `insertAll` | memory, a `defineDriver` store, row-security settings installed (a copy would skip the tenant `BEGIN`), a client with no `copyIn` — insert statements, no `returning`. While a search index or an `entity.row` subscriber listens: `insert … returning *` |
|
|
662
|
+
| Measured | as of 2026-11, 100k rows × 4 columns through the typed handle, Postgres 17 on loopback, Bun 1.4.4, median of 5 at load 13–15: `copyAll` 1,073 ms, `insertAll({ returning: false })` 2,778 ms, `insertAll` 2,880 ms |
|
|
663
|
+
|
|
664
|
+
### A filtered write is a chain terminal
|
|
665
|
+
|
|
666
|
+
`.updateAll(patch)` and `.deleteAll()` end any read chain: one statement over exactly the rows the
|
|
667
|
+
same chain's `.all()` would read, every operator included. `As of 2026-11`:
|
|
668
|
+
|
|
669
|
+
```ts
|
|
670
|
+
import { database, entity, enumerated, timestamp, uuid } from '@ultimat3/entity';
|
|
671
|
+
|
|
672
|
+
const likes = entity('likes', {
|
|
673
|
+
columns: { id: uuid().primaryKey(), orgId: uuid().tenant(), postId: uuid(), userId: uuid() },
|
|
674
|
+
});
|
|
675
|
+
const posts = entity('posts', {
|
|
676
|
+
columns: {
|
|
677
|
+
id: uuid().primaryKey(),
|
|
678
|
+
orgId: uuid().tenant(),
|
|
679
|
+
authorId: uuid(),
|
|
680
|
+
status: enumerated(['draft', 'live']),
|
|
681
|
+
publishedAt: timestamp().nullable(),
|
|
682
|
+
},
|
|
683
|
+
});
|
|
684
|
+
const db = database({ likes, posts });
|
|
685
|
+
|
|
686
|
+
// One statement each; resolves with how many rows it reached.
|
|
687
|
+
export const unlike = (postId: string, userIds: readonly string[]): Promise<number> =>
|
|
688
|
+
db.likes.where({ postId }).andWhere('userId', 'in', userIds).deleteAll();
|
|
689
|
+
|
|
690
|
+
export const parkUnpublished = (authorId: string): Promise<number> =>
|
|
691
|
+
db.posts.where({ authorId }).andWhere('publishedAt', 'is-null').updateAll({ status: 'draft' });
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
| Property | Behavior |
|
|
695
|
+
|---|---|
|
|
696
|
+
| One plan | `updateWhere(filter, patch)` / `deleteWhere(filter)` and the chain build the same plan (`write-where.ts`): tenancy, soft-delete reach, invariant judging, `onUpdateNow()`, sealing, the search mirror and the `entity.bulk` report cannot differ. The filter is the chain's equalities |
|
|
697
|
+
| Unbounded | no predicate is `X_WRITE_UNFILTERED`. So is a chain predicate whose value is `undefined` — dropped, it would widen the write to everything the rest of the chain matches; `.andWhere('<col>', 'is-null')` is SQL NULL. In `updateWhere`'s filter an `undefined` is dropped, as it always was |
|
|
698
|
+
| No page | `limit()`, `after()` and `search()` on a write chain are `X_INVARIANT_VIOLATED`: a write reaches every match, and a search index answers a bounded sample of ids. `orderBy`, `select` and `preload` are ignored |
|
|
699
|
+
| Sealed columns | a lookup column matched as a read matches it; a null test passes; any other predicate on a sealed column is refused |
|
|
700
|
+
|
|
701
|
+
### A different value per row is `updateMany`
|
|
702
|
+
|
|
703
|
+
`db.<table>.updateMany([{ id, patch }])` writes each row its own patch: one tenant-scoped
|
|
704
|
+
`update … from (select …)` per bind-count chunk, resolving with how many rows were written.
|
|
705
|
+
A chunk is ⌊(65,535 − the scope's binds) / (columns + 1)⌋ rows, so 1,000 one-column patches are one statement (`pg-update-many-sql.test.ts`). `As of 2026-11`:
|
|
706
|
+
|
|
707
|
+
```ts
|
|
708
|
+
import { database, entity, integer, uuid } from '@ultimat3/entity';
|
|
709
|
+
|
|
710
|
+
const posts = entity('posts', {
|
|
711
|
+
columns: { id: uuid().primaryKey(), orgId: uuid().tenant(), rank: integer() },
|
|
712
|
+
});
|
|
713
|
+
const db = database({ posts });
|
|
714
|
+
|
|
715
|
+
// Each row its own rank, one statement: resolves with how many rows were written.
|
|
716
|
+
export const rerank = (ranked: readonly { id: string; rank: number }[]): Promise<number> =>
|
|
717
|
+
db.posts.updateMany(ranked.map(({ id, rank }) => ({ id, patch: { rank } })));
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
| Property | Behavior |
|
|
721
|
+
|---|---|
|
|
722
|
+
| Shape | every patch names the same columns, each id appears once, a single-column primary key: else `X_INVARIANT_VIOLATED`. An empty patch is `X_PATCH_EMPTY` |
|
|
723
|
+
| Missing rows | an absent, soft-deleted or other tenant's id is neither written nor counted, never `X_NOT_FOUND` — `updateWhere`'s semantics |
|
|
724
|
+
| Atomicity | on Postgres one chunk is one autocommit statement; several chunks, or a JS-only invariant, run in one transaction. Memory and a `defineDriver` store judge the batch whole (tenant, invariants, uniques) before a row lands; a `defineDriver` store gets one `update` per row, and a store refusal part way writes the moved rows back |
|
|
725
|
+
| Typing | the source rows are typed from the table (`select … where false union all select $…`): `values (…)` binds as text and Postgres refuses `uuid = text` |
|
|
726
|
+
| Reports | `entity.bulk`, as `updateWhere` |
|
|
727
|
+
| A hand-written `Repo` | `updateMany`, `copyAll`, `insertAllCount` and `upsertAllCount` are optional on it. Absent, the typed handle sends one `updateWhere` per row, and `insertAll(…)` / `upsertAll(…)` counted |
|
|
599
728
|
|
|
600
729
|
The composite unique index the tenancy rule requires is emitted correctly since 2.0.0 — declare it
|
|
601
730
|
on the entity and generate. Through 1.2.0 `indexes: [{ on: ['orgId','createdAt'] }]` emitted one
|
|
@@ -889,7 +1018,7 @@ Rule: `.search(term)` on a chain asks the INSTALLED `SearchIndex` — one search
|
|
|
889
1018
|
|---|---|
|
|
890
1019
|
| the version | every `SearchDocument` carries `version`, the row's `onUpdateNow()` instant in epoch ms — STRICTLY increasing per row: a write (a soft delete included) stores it no earlier than the stored one + 1 ms (Postgres `greatest($now, updated_at + interval '1 millisecond')`; the memory driver and a `defineDriver` store through `advanceVersion` / `DriverRepo.update`'s `advance`), so two writes inside one millisecond are two versions and the column may run a millisecond ahead of the clock per same-ms write. A searchable entity declares `updatedAt: timestamp().defaultNow().onUpdateNow()`; without one `searchDocumentOf` and `reindex()` refuse (`X_INVARIANT_VIOLATED`) |
|
|
891
1020
|
| keep only newer | an adapter applies a document only when its version is newer than the document or tombstone it holds for that id; `remove(scope, ids, version)` leaves a tombstone (a delete's: past the row's last version and no earlier than its instant); an equal version is a replay. EXCEPT a `committed` document — the write path's, `index(docs, { committed: true })` — which replaces a tombstone whatever its version, so a key deleted and written again is live at once; `reindex()`'s reads are not `committed`, so a stale read never brings a deleted row back. `searchIndexConformance` (`@ultimat3/testing/conformance`) checks each case |
|
|
892
|
-
| the write path | with an external index installed, every committed write of a searchable entity reaches it: insert, upsert, update, transition and `
|
|
1021
|
+
| the write path | with an external index installed, every committed write of a searchable entity reaches it: insert, upsert, `copyAll`, update, transition, `updateWhere`/`updateAll` and `updateMany` index the rows written; `delete` and `deleteWhere`/`deleteAll` (soft or hard) remove them — whatever the primary key (`id`, another column, composite; an instant in a key is spelled ISO 8601 UTC). Taken when the write runs, merged per key per transaction, sent at commit on one chain per index (`search-mirror-batch.ts`), so a rolled-back write indexes nothing. The driver hands a delete's or filtered write's rows over (`returning *` on Postgres) only for a searchable entity under an external index; under the built-in index every write is the statement it always was |
|
|
893
1022
|
| a failed index write | never fails the business write: one `entity.search-index.write-failed` log line; repair with `reindex()` ([Jobs](Jobs-And-Workflows#rebuilding-a-search-index--reindex)), whose sweep also removes what the table lost |
|
|
894
1023
|
| not mirrored | a delete or filtered write past `MAX_ASSERTED_ROWS` rows: Postgres counts first and sends no `returning *` past it (memory and `defineDriver` stores the same) — logged the same way; `reindex()` repairs it |
|
|
895
1024
|
|
|
@@ -998,7 +1127,7 @@ of 2026-11:
|
|
|
998
1127
|
|
|
999
1128
|
| Rule | |
|
|
1000
1129
|
|---|---|
|
|
1001
|
-
| Writes | `insert`, `insertAll`, `upsertAll`, `update`, `delete`, `updateWhere`, `deleteWhere`, `lock`: `X_ENTITY_READ_ONLY`, in both drivers, before a statement exists, the reason in the cause |
|
|
1130
|
+
| Writes | `insert`, `insertAll`, `upsertAll`, `copyAll`, `update`, `delete`, `updateWhere`, `deleteWhere`, `updateMany`, a chain's `updateAll`/`deleteAll`, `lock`: `X_ENTITY_READ_ONLY`, in both drivers, before a statement exists, the reason in the cause |
|
|
1002
1131
|
| Refused at declaration | a blank reason, `view` (already read-only), `appendOnly` (it admits the inserts this refuses): `X_INVARIANT_VIOLATED` |
|
|
1003
1132
|
| Seeds | `x db seed --generate` and `x exercise` seed no row of it. A nullable reference into it is seeded null; a NOT NULL one is `X_SEED_GRAPH_UNSATISFIED` naming the table, its reason, and the fix: `readOnly` on the referencing table too, or `.nullable()` then `x db gen` |
|
|
1004
1133
|
| Subjects | `defineSubject`'s `'delete'` or `anonymize` on it is `X_SUBJECT_TREATMENT_INVALID`; `retain` is the one treatment that holds |
|
package/wiki/Upgrading.md
CHANGED
|
@@ -226,8 +226,11 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
226
226
|
| `x db gen` builds an index on an existing table `concurrently` by default (**31.8.0**), in a `-- transaction: false` follow-up file; `x verify` refuses an unmarked lock-heavy migration newer than `20261113000000` (`X_MIGRATION_LOCK_HEAVY`) | generated migrations: nothing. A hand-written `create index` on an existing table: `create index concurrently` in a file whose first line is `-- transaction: false`, or `-- lock-heavy: true` for a deliberate plain build. A hand-written `set not null`: a `check (… is not null) not valid` constraint, validated in the next migration, first |
|
|
227
227
|
| drift can newly report `changed-index` (**31.8.0**) for a live index of a declared name that a hand edit gave `INCLUDE` columns or a non-default operator class: drift now compares both | rebuild it as declared — `drop index concurrently` then `create index concurrently` in a `-- transaction: false` migration — or give the hand-built index a name of its own: a live index no snapshot names is never drift. An entity's `indexes:` cannot declare `include` or an operator class yet |
|
|
228
228
|
| an anonymous, compressible, public answer carries `W/"…"` whenever the request offers a coding (**31.8.0**), even when too small to be coded; the 304 carries the same form | nothing. A client comparing that ETag strongly switches to weak comparison |
|
|
229
|
-
| the boot runs `alter table x_rate_limit set unlogged` (**31.8.0**): a rewrite under ACCESS EXCLUSIVE of a tiny table, bounded by the migrate `lock_timeout`. After a Postgres crash, or on a promoted standby, every bucket comes back full — one free burst per key, never a lockout; a clean restart keeps the buckets. `x_auth_lockouts` stays logged |
|
|
229
|
+
| the boot runs `alter table x_rate_limit set unlogged` (**31.8.0**): a rewrite under ACCESS EXCLUSIVE of a tiny table, bounded by the migrate `lock_timeout`. After a Postgres crash, or on a promoted standby, every bucket comes back full — one free burst per key, never a lockout; a clean restart keeps the buckets. `x_auth_lockouts` stays logged. An app that commits the framework schema dump (`packages/db/schema/framework/`) sees `X_SCHEMA_DUMP_DRIFT` on `x_rate_limit` until it regenerates it | `x db gen` once, commit the regenerated `04_tables/x_rate_limit.sql` (now `create unlogged table … with (fillfactor=70)`); no migration |
|
|
230
230
|
| a routine 401/403/429 refusal logs `debug` after the first `info` line per route per minute (**31.8.0**) | an alert keyed on those `info` lines moves to the `http_refusals_total{code}` counter |
|
|
231
|
+
| a read whose page weighs more than `MAX_PAGE_BYTES` (64 MiB) before decoding is `X_ENTITY_PAGE_TOO_LARGE`, a 500 (**31.9.0**), on Postgres, memory and `defineDriver` alike — a test storing big rows in memory meets it too. Before, the page was decoded whole. `inBatches()` halves its batch instead of refusing, down to one row | paste the `fix:` onto that read: `.select({ … })` without the heaviest column it names, and the `.limit(n)` that fits — or `.inBatches(n)` to visit every row. A single row over 64 MiB on its own stays refused: move that value to storage |
|
|
232
|
+
| `updateMany`, `copyAll` and the `{ returning: false }` forms (**31.9.0**) reach a hand-written `Repo` — a `Driver.repo()` not built with `defineDriver` — through fallbacks, as optional members: `updateMany` is one `updateWhere` per row (n statements, no duplicate-id or same-columns refusal, atomic only inside `withTransaction`), `copyAll` and a count form are `insertAll(…)` / `upsertAll(…)` counted. A `defineDriver` store needs nothing | nothing. For one statement, implement `updateMany`, `insertAllCount`, `upsertAllCount` and `copyAll` on the repository (`Repo` in `@ultimat3/entity`) |
|
|
233
|
+
| `deletePlan` / `updatePlan` from `@ultimat3/entity/adapter` are the shipped names of `writeWherePlan` / `updateWherePlan` (**31.9.0**): the same arguments and refusals, plus an optional `options.where` for a chain's predicates | nothing |
|
|
231
234
|
|
|
232
235
|
## 29.x → 30.0.0, entry by entry
|
|
233
236
|
|