Documentation ¶
Index ¶
- type ExecutiveQueryBuilder
- func (b *ExecutiveQueryBuilder) Exec(ctx context.Context) (commandTag pgconn.CommandTag, err error)
- func (b *ExecutiveQueryBuilder) Query(ctx context.Context) (rows pgx.Rows, err error)
- func (b *ExecutiveQueryBuilder) QueryRow(ctx context.Context) (row pgx.Row, err error)
- func (b *ExecutiveQueryBuilder) WithNamedArgs(args map[string]any) *ExecutiveQueryBuilder
- func (b *ExecutiveQueryBuilder) WithoutValidation() *ExecutiveQueryBuilder
- type Executor
- type ExecutorBuilder
- type QueryBuilder
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)
func (*ExecutiveQueryBuilder) Query ¶
func (b *ExecutiveQueryBuilder) Query(ctx context.Context) (rows pgx.Rows, err error)
func (*ExecutiveQueryBuilder) QueryRow ¶
func (b *ExecutiveQueryBuilder) QueryRow(ctx context.Context) (row pgx.Row, err error)
func (*ExecutiveQueryBuilder) WithNamedArgs ¶ added in v0.2.4
func (b *ExecutiveQueryBuilder) WithNamedArgs(args map[string]any) *ExecutiveQueryBuilder
func (*ExecutiveQueryBuilder) WithoutValidation ¶ added in v0.2.4
func (b *ExecutiveQueryBuilder) WithoutValidation() *ExecutiveQueryBuilder
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.