From 602a9535d2b862460f932209324c0fb397a143d9 Mon Sep 17 00:00:00 2001 From: Domino Valdano <2644901+reductionista@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:55:54 -0700 Subject: [PATCH] Call RegisterTxDb from NewConnection if needed --- core/services/pg/connection.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/services/pg/connection.go b/core/services/pg/connection.go index 17d47af3f36..7881674c483 100644 --- a/core/services/pg/connection.go +++ b/core/services/pg/connection.go @@ -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)