denodrivers / postgres

PostgreSQL driver for Deno

Home Page:https://denodrivers.github.io/postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

commit({ chain: true }) will only commit once

abrgr opened this issue · comments

In commit (https://github.com/denodrivers/postgres/blob/main/query/transaction.ts#L283), we only send a commit to postgres once per transaction. However, with chain: true, we want to be able to commit multiple times. Shouldn't this be modified so that, if chain is true, this.#committed is set to false so that you can run multiple commit({ chain: true }) calls in a row and each will actually be sent to postgres?

Agree, this looks like a bug to me. PR for it here: #437