Repository navigation
Commit c22d3da
fix(docs): agent/schema.md read a DESC index as ascending
`agent/schema.md`'s stated job is "the physical shape of the `postgres` database
… read it before writing a query, a migration, or anything that names a table or
a column". It rendered a live `btree (ts DESC)` recency index as
- `wake_events_ts_idx` · index · on `ts`
The ordering IS the index for that shape: a reader deciding whether an existing
index serves their ORDER BY got the opposite answer.
`@where`, `@expr` and `@using` were all already rendered on the neighbouring
clause — the estate report guessed `@using` was dropped too and it is not. The one
member of the set missing was `orders`, and not from the renderer: the
`SchemaIndexLike` input type never carried the field, so the direction never
reached the page at all. migrate-ts's own descriptor has had it throughout.
Rendered PER COLUMN rather than per index, because `(device_id ASC, ts DESC)` is a
different index from `(device_id, ts)` and the per-column answer is the one a
reader needs. An all-ascending index stays plain — `asc` on every column would be
noise, and the test asserts that too.
codegen-ts 1576 pass, workspace typecheck clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTcEKXTQMYt84fAjuw5A2M1 parent ca7827c commit c22d3da
3 files changed
Lines changed: 52 additions & 1 deletion
File tree
- server/typescript/packages/codegen-ts
- src/generators
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
84 | 97 | | |
85 | | - | |
| 98 | + | |
86 | 99 | | |
87 | 100 | | |
88 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
272 | 299 | | |
273 | 300 | | |
274 | 301 | | |
| |||
0 commit comments