sqlOperators

a set of SQL operators used for creating SQL queries

object sqlOperators;

Example

// refers to the object with SQL operators
$$("qb").sqlOperators;

Details

The sqlOperators object contains a set of key:value pairs, where:

  • key - the name of the rule in Query Builder
  • value - an SQL operator object with necessary properties:
    • op - operator
    • sep - separator
    • mod - the mode of comparing a value to similar values
    • no_val - without value
sqlOperators: {
    equal:            { op: '= ?' },
    not_equal:        { op: '!= ?' },
    less:             { op: '< ?' },
    less_or_equal:    { op: '<= ?' },
    greater:          { op: '> ?' },
    greater_or_equal: { op: '>= ?' },
    between:          { op: 'BETWEEN ?',      sep: ' AND ' },
    not_between:      { op: 'NOT BETWEEN ?',  sep: ' AND ' },
    begins_with:      { op: 'LIKE(?)',        mod: '{0}%' },
    not_begins_with:  { op: 'NOT LIKE(?)',    mod: '{0}%' },
    contains:         { op: 'LIKE(?)',        mod: '%{0}%' },
    not_contains:     { op: 'NOT LIKE(?)',    mod: '%{0}%' },
    ends_with:        { op: 'LIKE(?)',        mod: '%{0}' },
    not_ends_with:    { op: 'NOT LIKE(?)',    mod: '%{0}' },
    is_empty:         { op: '= \"\"', no_val: true },
    is_not_empty:     { op: '!= \"\"', no_val: true },
    is_null:          { op: 'IS NULL', no_val: true },
    is_not_null:      { op: 'IS NOT NULL', no_val: true }
}
See also
Back to top