/** * Read-through TTL snapshots for expensive aggregate computations — * primarily the admin dashboard `/aggregates` endpoints (bookings, * products, suppliers, finance, availability), which otherwise recompute * 3-11 live queries on every dashboard load. * * `key` is a semantic cache key, NOT a typeid — e.g. * `finance:aggregates:`. Callers build it with * `aggregateSnapshotKey(...)` from `@voyantjs/db/aggregate-snapshots`, * which folds query params into the key so distinct param sets get * distinct snapshots. * * `payload` is the JSON-serialized computation result; `staleAfter` * marks the end of the freshness window. Rows past `staleAfter` are * recomputed in place by the next reader (upsert, last write wins) — * stale rows are never served, so no sweeper is required, but a * periodic `DELETE WHERE stale_after < now() - interval '...'` keeps * abandoned keys from accumulating (hence the `stale_after` index). */ export declare const aggregateSnapshots: Omit; payload: import("drizzle-orm/pg-core").PgColumn<{ name: "payload"; tableName: "aggregate_snapshots"; dataType: "json"; columnType: "PgJsonb"; data: unknown; driverParam: unknown; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; computedAt: import("drizzle-orm/pg-core").PgColumn<{ name: "computed_at"; tableName: "aggregate_snapshots"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; staleAfter: import("drizzle-orm/pg-core").PgColumn<{ name: "stale_after"; tableName: "aggregate_snapshots"; dataType: "date"; columnType: "PgTimestamp"; data: Date; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, {}>; }; dialect: "pg"; }>, "enableRLS">; export type SelectAggregateSnapshot = typeof aggregateSnapshots.$inferSelect; export type InsertAggregateSnapshot = typeof aggregateSnapshots.$inferInsert; //# sourceMappingURL=aggregate-snapshots.d.ts.map