Singyeong.Query (singyeong v0.2.0) View Source

Link to this section Summary

Functions

Creates a new query for the given target application

Converts the provided values into a proper boolean op.

Adds the provided logical op over the provided ops to the query.

Adds the provided boolean op to the query.

Adds the provided boolean op to the query.

Link to this section Types

Specs

boolean_op() :: %{required(boolean_op_name()) => term()}

Specs

boolean_op_name() ::
  :"$eq"
  | :"$ne"
  | :"$gt"
  | :"$gte"
  | :"$lt"
  | :"$lte"
  | :"$in"
  | :"$nin"
  | :"$contains"
  | :"$ncontains"

Specs

logical_op() :: %{
  required(logical_op_name()) => maybe_improper_list(boolean_op(), logical_op())
}

Specs

logical_op_name() :: :"$and" | :"$or" | :"$nor"

Specs

op() :: %{required(binary()) => boolean_op() | logical_op()}

Specs

ops() :: [op()] | []

Specs

t() :: %Singyeong.Query{
  application: String.t(),
  droppable: boolean(),
  key: String.t() | nil,
  ops: [op()],
  optional: boolean(),
  restricted: boolean()
}

Link to this section Functions

Specs

new(String.t()) :: t()

Creates a new query for the given target application

Link to this function

values_to_op(op, key, value)

View Source

Specs

values_to_op(boolean_op_name(), String.t(), term()) :: boolean_op()

Converts the provided values into a proper boolean op.

Link to this function

with_logical_op(query, logical_op, op1, op2)

View Source

Specs

with_logical_op(t(), logical_op_name(), op(), op()) :: t()

Adds the provided logical op over the provided ops to the query.

Specs

with_op(t(), boolean_op()) :: t()

Adds the provided boolean op to the query.

Link to this function

with_op(query, op, key, value)

View Source

Specs

with_op(t(), boolean_op_name(), String.t(), term()) :: t()

Adds the provided boolean op to the query.