Moose lets you declare ClickHouse TTL directly in your data model:
ttl option on OlapTable configClickHouseTTL on individual fieldsimport { OlapTable, ClickHouseEngines, Key, DateTime, ClickHouseTTL } from "@514labs/moose-lib"; interface Event { id: Key<string>; timestamp: DateTime; email: string & ClickHouseTTL<"timestamp + INTERVAL 30 DAY">; // column TTL} export const Events = new OlapTable<Event>("Events", { engine: ClickHouseEngines.MergeTree, orderByFields: ["id", "timestamp"], // Provide the ClickHouse TTL expression without the leading 'TTL' ttl: "timestamp + INTERVAL 90 DAY DELETE", // table TTL});TTL keyword.ALTER TABLE ... MODIFY TTL and MODIFY COLUMN ... TTL.