AshDyan.Info (AshDyan v0.1.0)

Copy Markdown View Source

Introspection helpers for the dyan DSL configuration of a resource.

These read back the whitelist declared in the dyan do ... end section so the engine can validate runtime requests against it.

Summary

Functions

Returns the list of attributes a runtime request may filter on.

Returns true if the resource declares any analyzable fields at all.

Returns the AnalyzableField for a given name and type, or nil.

Returns the list of AshDyan.Dsl.AnalyzableField entities for a resource.

Returns the default row limit.

Returns the maximum number of group_by fields allowed.

Returns the maximum row limit (hard cap).

Returns the configured per-request query timeout (ms).

Functions

allow_filters_on(resource)

@spec allow_filters_on(module()) :: [atom()]

Returns the list of attributes a runtime request may filter on.

analyzable?(resource)

@spec analyzable?(module()) :: boolean()

Returns true if the resource declares any analyzable fields at all.

analyzable_field(resource, name, type)

@spec analyzable_field(
  module(),
  atom(),
  :frequency | :aggregate | :time_bucket | :percentile
) ::
  AshDyan.Dsl.AnalyzableField.t() | nil

Returns the AnalyzableField for a given name and type, or nil.

analyzable_fields(resource)

@spec analyzable_fields(module()) :: [AshDyan.Dsl.AnalyzableField.t()]

Returns the list of AshDyan.Dsl.AnalyzableField entities for a resource.

Reads the normalized, persisted view produced by the SetDefaults transformer at compile time for fast runtime access.

default_limit(resource)

@spec default_limit(module()) :: pos_integer()

Returns the default row limit.

max_group_by(resource)

@spec max_group_by(module()) :: pos_integer()

Returns the maximum number of group_by fields allowed.

max_limit(resource)

@spec max_limit(module()) :: pos_integer()

Returns the maximum row limit (hard cap).

query_timeout(resource)

@spec query_timeout(module()) :: pos_integer()

Returns the configured per-request query timeout (ms).