const format = require('pg-format');
const data = [
{ id: 1, status: 'ok', type: 'def', time: '22:15' },
{ id: 2, status: 'error', type: 'error', time: '22:15' },
{ id: 3, status: 'ok', type: 'def', time: '22:15' },
]
const queryData = data.map((item) => [item.id, item.status, item.type, item.time])
const query = format('INSERT INTO public.orders(id, status, type, time) VALUES %L', queryData)
await pool.query(query)