skul
Version:
SKuL - SQL query manager
48 lines (29 loc) • 1.02 kB
Markdown
Add a custom entry for the select building.
The `key` argument must be a `string` and represent the field to call to reach the custom entry.
The `custom` argument must be an `object`.
The `custom` object has `$field`, `$join` and `$groupby` keys, here an exemple :
```js
{
'$field': [
'COUNT(', { '$alias': 't1', '$key': 'id' }, ')'
],
'$join': [ { '$type': 'left', '$model': TripModel, '$alias': 't1', '$key': 'id_vehicle', '$on': 'id' } ],
'$groupby': [ { '$key': 'id' } ]
}
```
--------
Get a defined custom entry.
The `key` must be a `string` and is the field supplied in the `addCustom` method.
--------
Get all defined custom entries.
--------
Remove a defined custom entry.
The `key` must be a `string` and is the field supplied in the `addCustom` method.
--------
Get keys of all defined custom entries.