Module: optimizeComparing

provides a mechanism to make multiple select with a single sql command
Source:

Classes

MultiCompare
MultiCompare
OptimizedMultiCompare
OptimizedMultiCompare
Select
Select

Methods

(inner) appendTo(other) → {boolean}

appends this Select to another one or-joining their conditions, returns true if appending succeeded
Parameters:
Name Type Description
other Select
Source:
Returns:
Type
boolean

(inner) canAppendTo(other) → {boolean}

Check if this Select can be appended to another one, i.e., has same tableName and alias
Parameters:
Name Type Description
other Select
Source:
Returns:
Type
boolean

(inner) from(tableName) → {Select}

Sets the table associated to this select
Parameters:
Name Type Description
tableName string
Source:
Returns:
Type
Select

(inner) getFilter() → {sqlFun}

Gets the overall filter for this multi select
Source:
Returns:
Type
sqlFun

(inner) getFilter() → {sqlFun}

Gets the overall filter for this multi select
Source:
Returns:
Type
sqlFun

(inner) getPartialFilter() → (nullable) {sqlFun}

get the partial filter (excluding static filter) associated with this Select
Source:
Returns:
Type
sqlFun

(inner) groupSelect(selectList)

Takes a list of Select to same table and evaluates an equivalent Select joining all input filters
Parameters:
Name Type Description
selectList Array.<Select>
Source:

(inner) hasValue(value, index) → {boolean}

check if this comparison has a specified value for the index-th field
Parameters:
Name Type Description
value object
index int
Source:
Returns:
Type
boolean

(inner) intoTable(alias) → {Select}

Sets a destination table for this select (alias)
Parameters:
Name Type Description
alias string
Source:
Returns:
Type
Select

(inner) isMultiValue() → {boolean}

checks if this is a simple comparator or multi-value comparator
Source:
Returns:
Type
boolean

(inner) multiCompare(multiComp) → {Select}

Sets the filter as a multi comparator. Here we call it 'optimized'
Parameters:
Name Type Description
multiComp MultiCompare
Source:
Returns:
Type
Select

(inner) optimizedAppendTo(other) → {boolean}

Tries to append this Select to another one in an optimized way and returns true on success An optimized Append is possible only if two select are both optimized
Parameters:
Name Type Description
other Select
Source:
Returns:
Type
boolean

(inner) orderBy(sorting) → {Select}

set the sorting for the select
Parameters:
Name Type Description
sorting
Source:
Returns:
Type
Select

(inner) sameFieldsAs(multiComp) → {boolean}

checks if this has same comparison fields of another multi compare
Parameters:
Name Type Description
multiComp MultiCompare
Source:
Returns:
Type
boolean

(inner) sameFieldsAs(optimizedComparer) → {boolean}

Parameters:
Name Type Description
optimizedComparer OptimizedMultiCompare
Source:
Returns:
Type
boolean

(inner) top(nopt) → {string|Select}

sets the top options for the query
Parameters:
Name Type Attributes Description
n string <optional>
Source:
Returns:
Type
string | Select

(inner) where(filter) → {Select}

sets the manual filter for this Select. We call this kind of filtering not-optimized
Parameters:
Name Type Description
filter sqlFun
Source:
Returns:
this
Type
Select