MCPcopy Index your code
hub / github.com/simstudioai/sim / schemaFingerprint

Function schemaFingerprint

apps/sim/lib/table/snapshot-cache.ts:62–65  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

60 * is also the seam for a future column-subset / filtered projection (mix it into the same hash).
61 */
62function 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. */
68function snapshotKey(

Callers 1

getOrCreateTableSnapshotFunction · 0.85

Calls 1

getColumnIdFunction · 0.90

Tested by

no test coverage detected