pgCondition
This "modifier step" (not an ExecutableStep) is commonly acquired from
$pgSelect.wherePlan()
, $pgSelect.havingPlan()
, or similar methods. It's
useful for building up a condition (WHERE
or HAVING
clause) bit by bit.
This is an advanced step, you probably will never use it unless you're building advanced filtering capabilities into your GraphQL schema.
pgConditions are created with a parent (a PgConditionCapableStep - typically another PgConditionStep, a PgSelectStep, or similar) and a mode:
PASS_THRU
- passes conditions directly up to the parentAND
- combines conditons withAND
and passes the result up to the parentOR
- combines the conditions withOR
and passes the result up to the parentNOT
- combines the conditons withAND
, groups them together and does aNOT
of the result, which is then passed up to the parentEXISTS
- builds anEXISTS(...)
expression utilising the conditions and passes it up to the parent
$pgCondition.orPlan()
Returns a child pgCondition in OR
mode.
$pgCondition.andPlan()
Returns a child pgCondition in AND
mode.
$pgCondition.notPlan()
Returns a child pgCondition in NOT
mode.
$pgCondition.existsPlan(options)
Returns a child pgCondition in EXISTS
mode with the given options.
$pgCondition.where(condition)
Adds condition
to the list of conditions. Cannot be used in "having" mode.
$pgCondition.having(condition)
Adds condition
to the list of conditions. Cannot be used unless in "having" mode.
$pgCondition.placeholder($step, codec)
Equivalent to $pgSelect.placeholder($step, codec)