I'm working with pgpromise to batch my insert queries however they are executed without waiting on the batch transaction batch.
db.tx((t) => {
const insertQueries = [];
queryInfo.forEach((info) => {
insertQueries.push(
t.none(
`INSERT INTO test
(name)
VALUES
('test')`,
[]
)
);
});
// return t.batch(insertQueries);
});
Note that t.batch is commented out. I would therefore (possibly erronously) expect for the queries to not get executed. However the database is showing the inserted rows. If this is not the case, how can I ensure that all the transaction are actually executed how I expect them to?
