View Source Luminous.Query behaviour (luminous v0.1.0)

a query is embedded in a panel and contains a function which will be executed upon panel refresh to fetch the query's data

Link to this section Summary

Callbacks

a module must implement this behaviour to be passed as an argument to define/3 a query must return a list of 2-tuples

Functions

initialize a query at compile time the module must implement the Query behaviour

execute the query and return the data as multiple TimeSeries structs

Link to this section Types

@type t() :: %Luminous.Query{id: atom(), mod: module()}

Link to this section Callbacks

a module must implement this behaviour to be passed as an argument to define/3 a query must return a list of 2-tuples:

  • the 2-tuple's first element is the time series' label
  • the 2-tuple's second element is the label's value the list must contain a 2-tuple with the label :time and a DateTime value

Link to this section Functions

@spec define(atom(), module()) :: t()

initialize a query at compile time the module must implement the Query behaviour

Link to this function

execute(query, time_range, variables)

View Source

execute the query and return the data as multiple TimeSeries structs