MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / dimStatement

Function dimStatement

telemetry-worker/src/rollup.ts:103–110  ·  view source on GitHub ↗

One dimension whose value is a scalar column or a scalar prop.

(dim: string, value: string, where = LIFECYCLE)

Source from the content-addressed store, hash-verified

101
102/** One dimension whose value is a scalar column or a scalar prop. */
103function dimStatement(dim: string, value: string, where = LIFECYCLE): string {
104 return `INSERT INTO daily_dim_counts (day, event, dim, value, count, machines)
105 SELECT e.day, e.event, '${dim}', CAST(${value} AS TEXT), count(*), count(DISTINCT e.machine_id)
106 FROM events e
107 WHERE e.day = ? AND ${value} IS NOT NULL AND ${value} <> ''${where}
108 GROUP BY e.day, e.event, ${value}
109 ${DIM_CONFLICT}`;
110}
111
112/**
113 * One usage dimension, from a `usage_daily` column. Absent values are stored as ''

Callers 1

rollup.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected