MCPcopy
hub / github.com/dittofeed/dittofeed / createInternalEventsTable

Function createInternalEventsTable

packages/admin-cli/src/upgrades.ts:959–982  ·  view source on GitHub ↗
({
  backfillLimit = 50000,
  intervalMinutes = 1440,
}: {
  backfillLimit?: number;
  intervalMinutes?: number;
})

Source from the content-addressed store, hash-verified

957}
958
959export async function createInternalEventsTable({
960 backfillLimit = 50000,
961 intervalMinutes = 1440,
962}: {
963 backfillLimit?: number;
964 intervalMinutes?: number;
965}) {
966 logger().info("Creating internal events table and materialized view");
967 await command({
968 query: CREATE_INTERNAL_EVENTS_TABLE_QUERY,
969 clickhouse_settings: { wait_end_of_query: 1 },
970 });
971 await command({
972 query: CREATE_INTERNAL_EVENTS_TABLE_MATERIALIZED_VIEW_QUERY,
973 clickhouse_settings: { wait_end_of_query: 1 },
974 });
975 logger().info("Backfilling internal events");
976
977 await backfillInternalEvents({
978 forceFullBackfill: true,
979 limit: backfillLimit,
980 intervalMinutes,
981 });
982}
983
984export async function upgradeV023Pre({
985 internalEventsBackfillLimit = 50000,

Callers 1

upgradeV023PreFunction · 0.85

Calls 3

commandFunction · 0.90
loggerFunction · 0.85
backfillInternalEventsFunction · 0.85

Tested by

no test coverage detected