View Source Plausible.Stats.Query (Plausible v0.0.1)

Summary

Types

@type t() :: %Plausible.Stats.Query{
  date_range: term(),
  dimensions: term(),
  experimental_reduced_joins?: term(),
  filters: term(),
  include: term(),
  include_imported: term(),
  interval: term(),
  latest_import_end_date: term(),
  legacy_breakdown: term(),
  metrics: term(),
  now: term(),
  order_by: term(),
  period: term(),
  preloaded_goals: term(),
  sample_threshold: term(),
  skip_imported_reason: term(),
  timezone: term(),
  v2: term()
}

Functions

Link to this function

add_filter(query, filter)

View Source
Link to this function

ensure_include_imported(query, requested?)

View Source
@spec ensure_include_imported(t(), boolean()) ::
  :ok
  | {:error,
     :no_imported_data | :out_of_range | :unsupported_query | :not_requested}
@spec from(Plausible.Site.t(), map()) :: t()

Builds query from old-style params. New code should prefer Query.build

Link to this function

get_filter_by_prefix(query, prefix)

View Source
Link to this function

has_event_filters?(query)

View Source
Link to this function

put_experimental_reduced_joins(query, site, params)

View Source
Link to this function

put_imported_opts(query, site, params)

View Source
Link to this function

remove_filters(query, prefixes)

View Source
@spec trace(
  %Plausible.Stats.Query{
    date_range: term(),
    dimensions: term(),
    experimental_reduced_joins?: term(),
    filters: term(),
    include: term(),
    include_imported: term(),
    interval: term(),
    latest_import_end_date: term(),
    legacy_breakdown: term(),
    metrics: term(),
    now: term(),
    order_by: term(),
    period: term(),
    preloaded_goals: term(),
    sample_threshold: term(),
    skip_imported_reason: term(),
    timezone: term(),
    v2: term()
  },
  [atom()]
) :: %Plausible.Stats.Query{
  date_range: term(),
  dimensions: term(),
  experimental_reduced_joins?: term(),
  filters: term(),
  include: term(),
  include_imported: term(),
  interval: term(),
  latest_import_end_date: term(),
  legacy_breakdown: term(),
  metrics: term(),
  now: term(),
  order_by: term(),
  period: term(),
  preloaded_goals: term(),
  sample_threshold: term(),
  skip_imported_reason: term(),
  timezone: term(),
  v2: term()
}