MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / modifyTTL

Function modifyTTL

packages/db/src/clickhouse/migration.ts:118–132  ·  view source on GitHub ↗
({
  tableName,
  isClustered,
  ttl,
}: {
  tableName: string;
  isClustered: boolean;
  ttl: string;
})

Source from the content-addressed store, hash-verified

116}
117
118export const modifyTTL = ({
119 tableName,
120 isClustered,
121 ttl,
122}: {
123 tableName: string;
124 isClustered: boolean;
125 ttl: string;
126}) => {
127 if (isClustered) {
128 return `ALTER TABLE ${replicated(tableName)} ON CLUSTER '{cluster}' MODIFY TTL ${ttl}`;
129 }
130
131 return `ALTER TABLE ${tableName} MODIFY TTL ${ttl}`;
132};
133
134/**
135 * Generates ALTER TABLE statements for adding columns

Callers 2

upFunction · 0.90
upFunction · 0.90

Calls 1

replicatedFunction · 0.70

Tested by

no test coverage detected