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

Summary

Types

@type t() :: %Plausible.Stats.Query{
  debug_metadata: 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(),
  pagination: term(),
  period: term(),
  preloaded_goals: term(),
  remove_unavailable_revenue_metrics: term(),
  revenue_currencies: term(),
  sample_threshold: term(),
  skip_imported_reason: term(),
  timezone: term(),
  utc_time_range: term(),
  v2: term()
}

Functions

Link to this function

add_filter(query, filter)

View Source
Link to this function

build(site, schema_type, params, debug_metadata)

View Source
Link to this function

date_range(query, options \\ [])

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}
Link to this function

from(site, params, debug_metadata \\ %{}, now \\ nil)

View Source

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

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_top_level_filters(query, prefixes)

View Source

Removes top level filters matching any of passed prefix from the query.

Note that this doesn't handle cases with AND/OR/NOT and as such is discouraged from use.

Link to this function

set_include(query, key, value)

View Source
@spec trace(
  %Plausible.Stats.Query{
    debug_metadata: 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(),
    pagination: term(),
    period: term(),
    preloaded_goals: term(),
    remove_unavailable_revenue_metrics: term(),
    revenue_currencies: term(),
    sample_threshold: term(),
    skip_imported_reason: term(),
    timezone: term(),
    utc_time_range: term(),
    v2: term()
  },
  [atom()]
) :: %Plausible.Stats.Query{
  debug_metadata: 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(),
  pagination: term(),
  period: term(),
  preloaded_goals: term(),
  remove_unavailable_revenue_metrics: term(),
  revenue_currencies: term(),
  sample_threshold: term(),
  skip_imported_reason: term(),
  timezone: term(),
  utc_time_range: term(),
  v2: term()
}