constOperators property
constOperators is a constant map that maps operator names to their SQL equivalents.
This map is used to convert operator names in the query building process to their actual SQL syntax.
The keys are the operator names in camel case and the values are the corresponding SQL operators.
May be there is some operator that you can't use for now, but I will add functionality for this operators in the future. Here is what each key-value pair represents:
- 'equals': '=' - Represents the SQL equality operator.
- 'notEquals': '<>' - Represents the SQL inequality operator.
- 'greaterThan': '>' - Represents the SQL greater than operator.
- 'greaterThanOrEquals': '>=' - Represents the SQL greater than or equal to operator.
- 'lessThan': '<' - Represents the SQL less than operator.
- 'lessThanOrEquals': '<=' - Represents the SQL less than or equal to operator.
- 'like': 'LIKE' - Represents the SQL LIKE operator for pattern matching.
- 'notLike': 'NOT LIKE' - Represents the SQL NOT LIKE operator for pattern matching.
- 'between': 'BETWEEN' - Represents the SQL BETWEEN operator for range checking.
- 'notBetween': 'NOT BETWEEN' - Represents the SQL NOT BETWEEN operator for range checking.
- 'in': 'IN' - Represents the SQL IN operator for checking if a value is within a set of values.
- 'notIn': 'NOT IN' - Represents the SQL NOT IN operator for checking if a value is not within a set of values.
- 'isNull': 'IS NULL' - Represents the SQL IS NULL operator for checking if a value is NULL.
- 'isNotNull': 'IS NOT NULL' - Represents the SQL IS NOT NULL operator for checking if a value is not NULL.
- 'exists': 'EXISTS' - Represents the SQL EXISTS operator for checking if a subquery returns any row.
- 'notExists': 'NOT EXISTS' - Represents the SQL NOT EXISTS operator for checking if a subquery does not return any row.
- 'and': 'AND' - Represents the SQL AND operator for combining boolean expressions.
- 'or': 'OR' - Represents the SQL OR operator for combining boolean expressions.
- 'not': 'NOT' - Represents the SQL NOT operator for negating a boolean expression.
- 'distinct': 'DISTINCT' - Represents the SQL DISTINCT keyword for selecting unique rows.
- 'asc': 'ASC' - Represents the SQL ASC keyword for sorting in ascending order.
- 'desc': 'DESC' - Represents the SQL DESC keyword for sorting in descending order.
- 'innerJoin': 'INNER JOIN' - Represents the SQL INNER JOIN operator for combining rows from two or more tables.
- 'leftJoin': 'LEFT JOIN' - Represents the SQL LEFT JOIN operator for combining rows from two or more tables.
- 'crossJoin': 'CROSS JOIN' - Represents the SQL CROSS JOIN operator for producing the Cartesian product of two tables.
Implementation
static final Map<String, String> constOperators = {
'equals': '=',
'notEquals': '<>',
'greaterThan': '>',
'greaterThanOrEquals': '>=',
'lessThan': '<',
'lessThanOrEquals': '<=',
'like': 'LIKE',
'notLike': 'NOT LIKE',
'between': 'BETWEEN',
'notBetween': 'NOT BETWEEN',
'in': 'IN',
'notIn': 'NOT IN',
'isNull': 'IS NULL',
'isNotNull': 'IS NOT NULL',
'exists': 'EXISTS',
'notExists': 'NOT EXISTS',
'and': 'AND',
'or': 'OR',
'not': 'NOT',
'distinct': 'DISTINCT',
'asc': 'ASC',
'desc': 'DESC',
'innerJoin': 'INNER JOIN',
'leftJoin': 'LEFT JOIN',
'crossJoin': 'CROSS JOIN',
};