The sqlFilter module is used to convert the filter object into a SQL query string.
- Source
Methods
(inner) addValues(val) → {number}
The addValues method is used to add values to the SQLparams array.
Parameters:
Name | Type | Description |
---|---|---|
val | string |
- Source
Returns:
SQLparams.length
- Type:
- number
(inner) isValidParam(val, type)
Check whether val param is of expected type.
Parameters:
Name | Type | Description |
---|---|---|
val | * | |
type | string |
- Source
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:
Name | Type | Description |
---|---|---|
filter | Object |
- Source
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:
Name | Type | Description |
---|---|---|
filter | Object | |
params | Array |
- Source
Returns:
SQL query string
- Type:
- string