AshOps.QueryLang (ash_ops v0.2.3)
The query language for simple queries entered on the command-line.
This query language is not capable of expressing the full breadth of the Ash expression language. It is designed to provide a simple subset of filters available to users of AshOps. If you need something more advanced then it's probably a good idea to make a special read query filtered in the way you require and expose that as a mix task instead.
Syntax
The Ash Ops query language is very similar to the Ash expression syntax while not actually being Elixir.
Literals
true
andfalse
boolean literals.- Integer literals, eg
123
,-123
and0
. - Float literals, of the form
1.23
and-1.23
(ie not scientific notation). - String literals of delimited with both single ticks (
'
) and double ticks ("
) are interpreted as Elixir binaries. - Attribute path literals are entered directly, separated by
.
as necessary.
Infix operators
The following infix operators (and their aliases) are available:
&&
andand
,||
andor
,*
andtimes
,/
anddiv
,+
andplus
,-
andminus
,<>
andconcat
,in
,>
andgt
,>=
andgte
,<
andlt
,<=
andlte
,==
andeq
,!=
andnot_eq
.
Function calls
Function calls of the form function(arg, arg)
format are allowed. The
functions available are highly dependant on the extensions and data layer
being used by the resource being queried.
Summary
Functions
@spec parse(AshOps.entity(), nil | String.t()) :: {:ok, Ash.Query.t()} | {:error, any()}
Parse a query and return a compiled Ash.Query
struct.