Skip to content

Commit

Permalink
Call RegisterTxDb from NewConnection if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
reductionista committed Nov 2, 2024
1 parent dcb7a58 commit 602a953
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/services/pg/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ func NewConnection(ctx context.Context, uri string, dialect pgcommon.DialectName
// We can happily throw away the original uri here because if we are using
// txdb it should have already been set at the point where we called
// txdb.Register
var err error

err := pgcommon.RegisterTxDb(ctx, uri)
if err != nil {
return nil, fmt.Errorf("failed to register txdb: %w", err)
}
sqldb, err = otelsql.Open(string(dialect), uuid.New().String(), opts...)
if err != nil {
return nil, fmt.Errorf("failed to open txdb: %w", err)
Expand Down

0 comments on commit 602a953

Please sign in to comment.