knex-dal-has-many
Has-many relation mixin for knex-dal
Installation
npm install knex-dal-has-many
Usage
Given dal configuration
var hasMany = ;var dal = ;var itemsDal = ;var knex = ; var table = 'grids';var createAndUpdateFields = 'title'; moduleexports = ;
Allows to store hierarchical data with one function call:
var gridsDal = ; gridsDal;
Above code will create record in grids
table and then create two related records in grid_items
table.
Available methods
create
Create record with child records
update
Update record with child records