View Source Plausible.DataMigration.AcquisitionChannel (Plausible v0.0.1)

Creates dictionaries and functions to calculate acquisition channel in ClickHouse

Creates acquisition_channel columns in events_v2 and sessions_v2 tables. Run via Plausible.DataMigration.AcquisitionChannel.run(options)

Options:

  • add_column - creates the materialized column. Already done in a migration
  • update_column - Updates the column definition to use new function definitions. Defaults to true. Note that historical data is only updated if backfill is set to true or if it was never materialized.
  • backfill - backfills the data for the column. Speeds up calculations on historical data.

SQL files available at: priv/data_migrations/AcquisitionChannel/sql

Summary

Functions

Link to this function

confirm(message, func, default_choice \\ :yes)

View Source
Link to this function

do_run(name, query, options \\ [])

View Source
Link to this function

run_sql(name, assigns \\ [], options \\ [])

View Source

Runs a single SQL query in a file.

Valid options:

  • quiet - reduces output from running the SQL
  • params - List of query parameters.
  • query_options - passed to Repo.query
Link to this function

run_sql_confirm(name, assigns \\ [], options \\ [])

View Source
Link to this function

run_sql_multi(name, assigns \\ [], options \\ [])

View Source

Runs multiple SQL queries from a single file.

Note that each query must be separated by semicolons.

Link to this function

unwrap(name, assigns \\ [])

View Source