LifeCycle.DELETION_PROTECTED allows MooseStack to automatically add new database structures but prevents it from removing existing ones. This mode is perfect for production environments where you want to evolve your schema safely without risking data loss.
What Moose will do:
What Moose won't do:
import { OlapTable, LifeCycle, ClickHouseEngines } from "@514labs/moose-lib"; interface ProductEvent { id: string; productId: string; timestamp: Date; action: string;} const productAnalytics = new OlapTable<ProductEvent>("product_analytics", { orderByFields: ["timestamp", "productId"], engine: ClickHouseEngines.ReplacingMergeTree, lifeCycle: LifeCycle.DELETION_PROTECTED});from moose_lib import OlapTable, OlapConfig, LifeCycle, ClickHouseEnginesfrom pydantic import BaseModelfrom datetime import datetime class ProductEvent(BaseModel): id: str product_id: str timestamp: datetime action: str product_analytics = OlapTable[ProductEvent]("product_analytics", OlapConfig( order_by_fields=["timestamp", "product_id"], engine=ClickHouseEngines.ReplacingMergeTree, life_cycle=LifeCycle.DELETION_PROTECTED))