Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
15 lines
496 B
Go
15 lines
496 B
Go
package postgres
|
|
|
|
import (
|
|
"context"
|
|
"database/sql"
|
|
)
|
|
|
|
// DBConn is an interface that abstracts the *sql.DB, *sql.Tx and *sql.Conn types.
|
|
type DBConn interface {
|
|
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
|
|
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
|
|
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
|
|
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
|
|
}
|