I have 2 tables in SQL , i use KnexJS to inset data.
I use "batchInsert" utility to insert object to one table.
my question:
Let say that my tables is :
- Product
- Product_meta
Can i insert this object to both of tables in on KnexJS call:
let products =
[{
SKU: 'A',
title: 'product A',
product_meta: [
{ key: '_price', value: 20 },
{ key: '_qty', value: 10 }
]
}, {
SKU: 'B',
title: 'product B',
product_meta: [
{ key: '_price', value: 9 },
{ key: '_qty', value: 50 }
]
}];
thanks.