mirror of
https://github.com/hanzoai/analytics.git
synced 2026-10-30 15:05:29 +00:00
One OLAP backend, one env var (DATASTORE_URL), one dispatch key (DATASTORE). Fold the parallel clickhouse.ts client into datastore.ts — the superset: IN-array equality, OR matching, cohort match, excludeBounce — and route the 11 report/performance/replay query files through [DATASTORE]. runQuery drops the second CLICKHOUSE_URL switch that left those 11 files un-dispatched (TypeError 500) under DATASTORE_URL. Model cohortMatch/cohortActionName (QueryOptions) and paramName (Filter) in the types the builders already use. Fix the analytics-vs-umami database prefix in ClickHouse migrations 09/10 so the schema provisions against the analytics database.
18 lines
491 B
SQL
18 lines
491 B
SQL
-- Create session_replay
|
|
CREATE TABLE analytics.session_replay
|
|
(
|
|
replay_id UUID,
|
|
website_id UUID,
|
|
session_id UUID,
|
|
visit_id UUID,
|
|
chunk_index UInt32,
|
|
events String CODEC(ZSTD(3)),
|
|
event_count UInt32,
|
|
started_at DateTime64(6),
|
|
ended_at DateTime64(6),
|
|
created_at DateTime64(6) DEFAULT now64(6)
|
|
)
|
|
ENGINE = MergeTree()
|
|
PARTITION BY toYYYYMM(created_at)
|
|
ORDER BY (replay_id, website_id, session_id, visit_id, chunk_index)
|
|
SETTINGS index_granularity = 8192; |