Releases: BibiFock/vege-data
Releases · BibiFock/vege-data
upgrade dependencies + breaking change in getter functions
Pull Request: #10
Breaking change
Model functions
findBy, findByProps, getAll function are removed.
Now you can used:
- allByKeys: return all element with primary key in array, like removed function allBy
- allByProps: equivalent of findByProps
- getByProps: just an alias of allByProps who get the first result
Model config helper
Now you have access to simple string queries.
Currently, model.queries. returns sql-template-string object.
But if you need only simple string query it's possible like this model.queries.raw.
Example for select querie:
- model.queries.select() // generate a sql Template queries
- model.queries.raw.select // return query string
Upgrade project dependencies
Upgrade dependencies project, see #10 for more details
upgrade dependencies + fix installation script
1.0.3 upgrade dependencies + fix installation script
Add model.findByProps
Add new function findByProps
model.findByProps({ field: value, otherField: [value1, value2] });
Add param concat in helpers.concatValues:
// example with custom conditions requests
const conds = { name: 'goku', type: 'sayan' };
model.queries.select()
.append(
helpers.concatValues(
Object.keys(conds),
(key) => conds[key],
(index) => i > 0 ? ' AND ' : ' WHERE '
)
)
Add sort option
Add default sort options
1.0.0
v0.1.5
v0.1.4
v0.1.3
v0.1.2
add findBy method
v0.1.1 add findBy function