Conditions
@quik/database / Conditions
Variable: Conditions
constConditions:object
Defined in: database/src/repository/QWhereConditions.ts:219
Collection of condition factory functions Provides a convenient way to create various types of where conditions
Type Declaration
Between
Between: (
field,min,max) =>QWhereCondition=BetweenCondition
Creates a BETWEEN condition with inclusive bounds.
Parameters
field
string
Field name to check
min
unknown
Minimum value (inclusive)
max
unknown
Maximum value (inclusive)
Returns
Equal
Equal: (
field,value) =>QWhereCondition=EqualCondition
Creates a simple equality condition object.
Parameters
field
string
Field name to compare
value
unknown
Value to compare against
Returns
Example
const cond = EqualCondition('status', 'active');
// Produces: { field: 'status', value: 'active', operator: '=' }
GreaterThan
GreaterThan: (
field,value) =>QWhereCondition=GreaterThanCondition
Creates a field > value condition.
Parameters
field
string
Field name to compare
value
unknown
Value to compare against
Returns
GreaterThanOrEqual
GreaterThanOrEqual: (
field,value) =>QWhereCondition=GreaterThanOrEqualCondition
Creates a field >= value condition.
Parameters
field
string
Field name to compare
value
unknown
Value to compare against
Returns
In
In: (
field,value) =>QWhereCondition=InCondition
Creates an IN condition for the provided list of values.
Parameters
field
string
Field name to check
value
unknown[]
Array of values to check against
Returns
IsNull
IsNull: (
field) =>QWhereCondition=IsNullCondition
Creates an IS NULL condition.
Parameters
field
string
Field name to check
Returns
LessThan
LessThan: (
field,value) =>QWhereCondition=LessThanCondition
Creates a field < value condition.
Parameters
field
string
Field name to compare
value
unknown
Value to compare against
Returns
LessThanOrEqual
LessThanOrEqual: (
field,value) =>QWhereCondition=LessThanOrEqualCondition
Creates a field <= value condition.
Parameters
field
string
Field name to compare
value
unknown
Value to compare against
Returns
Like
Like: (
field,value) =>QWhereCondition=LikeCondition
Creates a LIKE pattern match condition.
Parameters
field
string
Field name to check
value
unknown
Pattern to match against
Returns
Not
Not: (
fieldOrCondition,value?,operator?) =>QWhereCondition=NotCondition
Negates a condition or creates a new negated comparison.
Parameters
fieldOrCondition
string | QWhereCondition
Field name or existing condition to negate
value?
string
Value to compare against (when using field name)
operator?
Operator to use (when using field name)
Returns
NotEqual
NotEqual: (
field,value) =>QWhereCondition=NotEqualCondition
Creates a field <> value condition object.
Parameters
field
string
Field name to compare
value
unknown
Value to compare against
Returns
NotLike
NotLike: (
field,value) =>QWhereCondition=NotLikeCondition
Creates a negated LIKE pattern condition.
Parameters
field
string
Field name to check
value
unknown
Pattern to not match against
Returns
NotNull
NotNull: (
field) =>QWhereCondition=NotNullCondition
Creates an IS NOT NULL condition.
Parameters
field
string
Field name to check
Returns
Typed()
Typed<
TModel>():QTypedConditions<TModel>
Returns a typed view of the condition helpers for a specific model.
Use this when you want field-name autocomplete based on the model type:
const cond = Conditions.Typed<User>().Equal('email', 'demo@example.com');
Type Parameters
TModel
TModel extends QModel
Returns
QTypedConditions<TModel>