* Fingerprint of the table's column shape (id + display name + order). `rows_version` only advances * on row mutations (the trigger fires on `user_table_rows`), so without this a schema edit — rename, * add, remove, or reorder a column — would change the CSV header/columns but keep the same key an
(table: TableDefinition)
| 60 | * is also the seam for a future column-subset / filtered projection (mix it into the same hash). |
| 61 | */ |
| 62 | function schemaFingerprint(table: TableDefinition): string { |
| 63 | const shape = table.schema.columns.map((c) => [getColumnId(c), c.name]) |
| 64 | return createHash('sha1').update(JSON.stringify(shape)).digest('hex').slice(0, 12) |
| 65 | } |
| 66 | |
| 67 | /** Storage key for a table's snapshot at a given row version + column shape. */ |
| 68 | function snapshotKey( |
no test coverage detected