Closed minaevmike closed 3 years ago
@minaevmike see the implementation of sqlhooks. There are many optional interfaces which sqlhooks does not implement. Depending on how many upstream drivers implement ConnBeginTx sqlhooks can always support it, or do a more complicated implementation which first checks the underlying driver (unfortunately go doesn't make it easy to hook in with the driver pattern).
But yeah, contributions welcome.
@minaevmike looks like you have a pretty good understanding of the solution, how long do you htink it could take to implement ConnBeginTx
?
@gchaincl I don't think that it would take a lot of time. If you are not mind I can do it.
@minaevmike please that would be great! as @keegancsmith contributions are welcome
@minaevmike any progress on this one?
func (conn *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
}
I can't start transaction with non default isolation level because connection returned from sqlhooks.Conn wrapper doesn't implement
driver.ConnBeginTx
interface https://github.com/golang/go/blob/master/src/database/sql/ctxutil.go#L100