Completed
Push — main ( d205ff...d7083f )
by Yume
24s queued 13s
created

db.*Queries.WithTx   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
// Code generated by sqlc. DO NOT EDIT.
2
// versions:
3
//   sqlc v1.25.0
4
5
package db
6
7
import (
8
	"context"
9
10
	"github.com/jackc/pgx/v5"
11
	"github.com/jackc/pgx/v5/pgconn"
12
)
13
14
type DBTX interface {
15
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
16
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
17
	QueryRow(context.Context, string, ...interface{}) pgx.Row
18
}
19
20
func New(db DBTX) *Queries {
21
	return &Queries{db: db}
22
}
23
24
type Queries struct {
25
	db DBTX
26
}
27
28
func (q *Queries) WithTx(tx pgx.Tx) *Queries {
29
	return &Queries{
30
		db: tx,
31
	}
32
}
33