Permit.Operators.DynamicQuery behaviour (permit_ecto v0.3.1)

Copy Markdown View Source

Implemented to define a dynamic query builder function for an operator, that is a module that implements Permit.Operators.GenOperator.

For example, when an operator is defined in the Permit.Operators.Eq module, its dynamic query builder function should be defined in Permit.Operators.Eq.DynamicQuery.

Part of the private API, subject to changes and not to be used on the application level.

Summary

Callbacks

dynamic_query_fn(struct_field, boolean)

@callback dynamic_query_fn(Permit.Types.struct_field(), boolean()) ::
  (any() ->
     %Ecto.Query.DynamicExpr{
       binding: term(),
       file: term(),
       fun: term(),
       line: term()
     })
  | nil