Documentation ¶
Index ¶
- type DBQuerier
- func (q *DBQuerier) CreateUser(ctx context.Context, email string, password string) (pgconn.CommandTag, error)
- func (q *DBQuerier) CreateUserBatch(batch genericBatch, email string, password string)
- func (q *DBQuerier) CreateUserScan(results pgx.BatchResults) (pgconn.CommandTag, error)
- func (q *DBQuerier) FindUser(ctx context.Context, email string) (FindUserRow, error)
- func (q *DBQuerier) FindUserBatch(batch genericBatch, email string)
- func (q *DBQuerier) FindUserScan(results pgx.BatchResults) (FindUserRow, error)
- type FindUserRow
- type Querier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBQuerier ¶
type DBQuerier struct {
// contains filtered or unexported fields
}
func NewQuerier ¶
func NewQuerier(conn genericConn) *DBQuerier
NewQuerier creates a DBQuerier that implements Querier. conn is typically *pgx.Conn, pgx.Tx, or *pgxpool.Pool.
func (*DBQuerier) CreateUser ¶
func (q *DBQuerier) CreateUser(ctx context.Context, email string, password string) (pgconn.CommandTag, error)
CreateUser implements Querier.CreateUser.
func (*DBQuerier) CreateUserBatch ¶
CreateUserBatch implements Querier.CreateUserBatch.
func (*DBQuerier) CreateUserScan ¶
func (q *DBQuerier) CreateUserScan(results pgx.BatchResults) (pgconn.CommandTag, error)
CreateUserScan implements Querier.CreateUserScan.
func (*DBQuerier) FindUserBatch ¶
FindUserBatch implements Querier.FindUserBatch.
func (*DBQuerier) FindUserScan ¶
func (q *DBQuerier) FindUserScan(results pgx.BatchResults) (FindUserRow, error)
FindUserScan implements Querier.FindUserScan.
type FindUserRow ¶
type Querier ¶
type Querier interface { CreateUser(ctx context.Context, email string, password string) (pgconn.CommandTag, error) // CreateUserBatch enqueues a CreateUser query into batch to be executed // later by the batch. CreateUserBatch(batch genericBatch, email string, password string) // CreateUserScan scans the result of an executed CreateUserBatch query. CreateUserScan(results pgx.BatchResults) (pgconn.CommandTag, error) FindUser(ctx context.Context, email string) (FindUserRow, error) // FindUserBatch enqueues a FindUser query into batch to be executed // later by the batch. FindUserBatch(batch genericBatch, email string) // FindUserScan scans the result of an executed FindUserBatch query. FindUserScan(results pgx.BatchResults) (FindUserRow, error) }
Querier is a typesafe Go interface backed by SQL queries.
Methods ending with Batch enqueue a query to run later in a pgx.Batch. After calling SendBatch on pgx.Conn, pgxpool.Pool, or pgx.Tx, use the Scan methods to parse the results.
Click to show internal directories.
Click to hide internal directories.