Roux.Query.Definition (roux v0.3.2)

Copy Markdown View Source

Describes a derived query: its name, the module and function that implement it, and any additional options.

Used by the defquery macro to record metadata that Roux.Database reads during module registration.

code and version make up the query's code version (see Roux.Query): the roots its code is read from beyond its own module (a list of modules, or {module, function, args} returning one), and a term a query's author bumps by hand.

store and transient are how a manifest keeps the query's entries (see Roux.Query): transient names the function the defquery generated from its transient: predicate.

opts[:boundary] names the generated timeout and fallback functions. The runtime applies this policy to validation and execution under one claim. opts[:revalidate] selects ordinary dependency validation or body execution when a memo needs checking.

Summary

Functions

Creates a new query definition.

Types

code()

@type code() :: [module()] | {module(), atom(), [term()]} | nil

t()

@type t() :: %Roux.Query.Definition{
  code: code(),
  function: atom(),
  module: module(),
  name: atom(),
  opts: keyword(),
  store: :inline | :blob | :none,
  transient: {module(), atom()} | nil,
  version: term()
}

Functions

new(name, module, function, opts \\ [])

@spec new(atom(), module(), atom(), keyword()) :: t()

Creates a new query definition.