We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f05f073 commit 357f88fCopy full SHA for 357f88f
internal/store/postgres/postgres.go
@@ -42,7 +42,11 @@ type Client struct {
42
}
43
44
func (c *Client) RunWithinTx(ctx context.Context, f func(tx *sqlx.Tx) error) error {
45
- tx, err := c.db.BeginTxx(ctx, nil)
+ return c.RunWithinTxWithOption(ctx, nil, f)
46
+}
47
+
48
+func (c *Client) RunWithinTxWithOption(ctx context.Context, opts *sql.TxOptions, f func(tx *sqlx.Tx) error) error {
49
+ tx, err := c.db.BeginTxx(ctx, opts)
50
if err != nil {
51
return fmt.Errorf("starting transaction: %w", err)
52
0 commit comments