Maybe I'm not using/understanding the "task" object correctly. When I do the following:
return await db.tx(async (task) => {
await.task.oneOrNone('INSERT INTO message (body) VALUES ('test') RETURNING id)
await task.oneOrNone('INSERT INTO user (name) VALUES ('bob') RETURNING id)
});
If the first insert fails I would expect for the second insert to fail. This however doesn't not seem to be the case. Please help me understand how to use task correctly from this example.