Promise.allSettled on independent queries looks safe in autocommit once every statement carries its own Sync. Put them inside an explicit BEGIN and the first failed statement aborts the whole transaction, so later pipelined queries still send their own Sync and come back as the current transaction is aborted. Mixed DML settles as partial success at the client while the txn is already dead on that connection. Sequential await still has to own anything you share that BEGIN with, even when the statements never read each other.
Sanoary Istiaque
Exploring how chatbots and AI automation make business simpler, faster, and more efficient.
Great article! It’s fascinating how a small change like enabling query pipelining can have such a significant impact on database performance. The explanation of reducing network round trips and improving throughput in Node.js with PostgreSQL was both practical and easy to follow. These kinds of optimizations are especially valuable for developers working on high-performance applications.