0.4.3Generic model for bookshelf ORM
Extends bookshelf.Model
A mix of bookshelf and custom options (override this with the desired one)
Type: GenericModelParams
The GenericModel params used internally
Type: GenericModelParams
The default filter params for [.getAll]GenericModel.getAll
Type: Object
The default fetch for [.getAll]GenericModel.getAll
Type: Object
The default filter params for [.getCount]GenericModel.getCount
Type: Object
Returns the list of objects
| Name | Description |
|---|---|
params.page Number
|
The
page
itens
|
params.pageSize Number
|
The
page
size
|
params.orderBy (Object | string)
|
The
attrName
to order for (asc) or an object,
attrName: 'ASC | DESC'
|
params.distinct Array
|
The
distinct
attrs to group
|
params.genericSearch string
|
The
genericSearch
text
|
(Object
= {})
The
bookshelf
fetch options (@see
https://bookshelfjs.org/api.html#Model-instance-fetch
)
Promise<Array>:
The resulted list
Contains a set of sql query builder utils
Returns a list of attrNames concatened with each operator QueryBuilderUtils.OPERATORS
Array:
The list of
attrsOperators
const attrNames = ['la', 'le', 'li']
QueryBuilderUtils.getAttrsOperators(attrNames)
// ['la_start', 'la_end', ..., 'le_end', 'le_like', ..., 'li_likeIgnoreCase', 'li_in', ...]
QueryBuilderUtils.getAttrsOperators('la')
// ['la_start', 'la_end', 'la_like', 'la_likeIgnoreCase', ...]
Returns a list of attrName concatened with each operator QueryBuilderUtils.OPERATORS
Array:
The list of
attrOperators
const attrName = 'la'
QueryBuilderUtils.getAttrOperators('la')
// ['la_start', 'la_end', 'la_like', 'la_likeIgnoreCase', ...]
QueryBuilderUtils.getAttrOperators(null)
// []
Returns the [operator object]QueryBuilderUtils.OPERATORS
Object:
The
[
operator
object]
QueryBuilderUtils.OPERATORS