Skip to contents

Condition is two-argument function such as `|` or `&` used to combine pair of rules.

Usage

queryCondition(method)

setQueryConditions(..., .queryBuilderConfig = queryBuilderConfig)

listQueryConditions(.queryBuilderConfig = queryBuilderConfig, print = TRUE)

default_conditions

Format

An object of class list of length 2.

Arguments

method

R function of two parameters that is used to combine a pair of rules.

...

Name-value pairs defining condition name and method respectively. Should be defined with usage of queryCondition function.

.queryBuilderConfig

R6 class object storing query configuration. See queryBuilderConfigClass.

print

Should the list of operators be printed into console?

Details

  • queryCondition: defines condition method.

  • setQueryConditions: is used to register the defined conditions in the default or custom queryBuilderConfigClass object.

  • listQueryConditions: returns list of registered conditions.

  • default_conditions: an object storing default definitions for conditions.

Examples

setQueryConditions(
  "XOR" = queryCondition(xor)
)
query <- queryGroup(
  condition = "XOR",
  queryRule("am", "equal", 1),
  queryRule("vs", "equal", 1)
)
queryToExpr(query)
#> xor(am == 1, vs == 1)