AshDyan.Adapters.PhoenixController (AshDyan v0.1.0)

Copy Markdown View Source

A thin Phoenix controller adapter for AshDyan.

This is intentionally minimal — AshDyan is not coupled to Phoenix. Drop this into a controller, or copy the body into your own. It translates controller params into an AshDyan.Request, runs it, and renders JSON.

Example

defmodule MyAppWeb.AnalysisController do
  use MyAppWeb, :controller
  alias AshDyan.Adapters.PhoenixController

  def analyze(conn, params) do
    PhoenixController.analyze(conn, params)
  end
end

Summary

Functions

Run an analysis from controller params and render the result as JSON.

Functions

analyze(conn, params)

Run an analysis from controller params and render the result as JSON.

Recognized params (all optional except resource/type): domain, resource, type, column, function, bucket, time_field, group_by (comma-separated or list), percentiles (comma-separated or list), filters (map), limit.