Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutiveQueryBuilder ¶
type ExecutiveQueryBuilder struct {
*builder.QueryBuilder
// contains filtered or unexported fields
}
func (*ExecutiveQueryBuilder) Exec ¶
func (b *ExecutiveQueryBuilder) Exec(ctx context.Context) (commandTag pgconn.CommandTag, err error)
type Executor ¶
type Executor interface {
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
}
Executor is the interface that wraps the basic Query, QueryRow and Exec methods. It allows to use pgx conn, pool and tx as an executor.
type ExecutorBuilder ¶
type ExecutorBuilder struct {
// contains filtered or unexported fields
}
func NewExecutorBuilder ¶
func NewExecutorBuilder(executor Executor) *ExecutorBuilder
NewExecutorBuilder starts with an Executor and allows to build an executable query via ExecutorBuilder.Build.
func (*ExecutorBuilder) Build ¶
func (b *ExecutorBuilder) Build(builder builder.SQLWriter) *ExecutiveQueryBuilder
type QueryBuilder ¶
type QueryBuilder struct {
*builder.QueryBuilder
}
func Build ¶
func Build(builder builder.SQLWriter) *QueryBuilder
Build a new QueryBuilder that can execute queries via pgx conn / tx after calling QueryBuilder.WithExecutor.
func (*QueryBuilder) WithExecutor ¶
func (b *QueryBuilder) WithExecutor(executor Executor) *ExecutiveQueryBuilder
WithExecutor sets the executor to use for the query. It can be a pgx conn or tx.
Click to show internal directories.
Click to hide internal directories.