The sqlFilter module is used to convert the filter object into a SQL query string.

Methods

(inner) addValues(val) → {number}

The addValues method is used to add values to the SQLparams array.

Parameters:
NameTypeDescription
valstring
Returns:

SQLparams.length

Type: 
number

(inner) isValidParam(val, type)

Check whether val param is of expected type.

Parameters:
NameTypeDescription
val*
typestring
Returns:

boolean

(inner) mapFilterEntries(filter) → {string}

The mapFilterEntries method is used to map the filter entries and convert them into a SQL query string. The method also validates the filter entries against SQL parameter validation.

Parameters:
NameTypeDescription
filterObject
Returns:

SQL query string

Type: 
string

(inner) sqlfilter(filter, params) → {string}

The sqlfilter method is used to convert the filter object into a SQL query string. If the filter is an array, the filter will be conditional OR. If the filter is a string, the filter will be returned as is.

Parameters:
NameTypeDescription
filterObject
paramsArray
Returns:

SQL query string

Type: 
string