DBPool is an interface that abstracts the pgxpool.Pool and pgxpool.Conn types for easier fine-grained testing.
| 29 | |
| 30 | // DBPool is an interface that abstracts the pgxpool.Pool and pgxpool.Conn types for easier fine-grained testing. |
| 31 | type DBPool interface { |
| 32 | Acquire(ctx context.Context) (*pgxpool.Conn, error) |
| 33 | Close() |
| 34 | Exec(ctx context.Context, query string, args ...any) (pgconn.CommandTag, error) |
| 35 | Query(ctx context.Context, query string, args ...any) (pgx.Rows, error) |
| 36 | QueryRow(ctx context.Context, query string, args ...any) pgx.Row |
| 37 | SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults |
| 38 | } |
| 39 | |
| 40 | type Client struct { |
| 41 | conn DBPool |
no outgoing calls
no test coverage detected