Skip to content

sqlWhereClause

sqlWhereClause<Predicate>(outcome, conditions?): string

Returns the search condition for one outcome, including the constant outcomes.

matchAll and matchNone are not predicates, so a caller that branches on the outcome by hand can reach an unrestricted query by forgetting one of them. This substitutes a condition that selects every record or no record, which keeps the emitted query restricted in every case.

A target whose dialect has no Boolean literal supplies its own conditions, such as 1 = 1 and 1 = 0.

Predicate extends SqlPredicateShape

TranslationOutcome<Predicate>

Outcome that a translator produced.

SqlOutcomeConditions = {}

Conditions substituted for the constant outcomes.

string