You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pg.DB type has a fair amount of baggage from it's initial iteration when we did not have the current transaction-passing approach to scoping of queries. In the previous model everything used the top Execute method of the DB type, where the presence of a transaction was kept internal, rather than the Execute method of a transaction type returned from BeginTx et al.
We should pare down the pg.DB type by removing this cruft. I'm pretty certain that there is no longer a need to have pg.DB be a sql.Executor and thus no need to have a singleton transaction tracked inside the pg.DB type.
Making these changes will make the type easier to use and more flexible, such as being able to start multiple write transactions, which is presently blocked if beginWriterTx sees that the db.tx field is already set.
This will involve a fair bit of rewriting, which is why it has not been done yet.
The text was updated successfully, but these errors were encountered:
The
pg.DB
type has a fair amount of baggage from it's initial iteration when we did not have the current transaction-passing approach to scoping of queries. In the previous model everything used the topExecute
method of the DB type, where the presence of a transaction was kept internal, rather than theExecute
method of a transaction type returned fromBeginTx
et al.We should pare down the
pg.DB
type by removing this cruft. I'm pretty certain that there is no longer a need to havepg.DB
be asql.Executor
and thus no need to have a singleton transaction tracked inside thepg.DB
type.Making these changes will make the type easier to use and more flexible, such as being able to start multiple write transactions, which is presently blocked if
beginWriterTx
sees that thedb.tx
field is already set.This will involve a fair bit of rewriting, which is why it has not been done yet.
The text was updated successfully, but these errors were encountered: