Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func WithStatementRunner ¶ added in v0.26.1
func WithStatementRunner(tx *sql.Tx, callback func(*StatementRunner) error) (err error)
WithStatementRunner seals admission, joins accepted execution and closes the retained statement before returning. Callback/execution/cleanup errors are retained even if the callback ignores an execution error. Panics propagate after cleanup. The caller alone must commit or roll back tx.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder represent update DML builder
type RunnerPanicError ¶ added in v0.26.1
RunnerPanicError preserves a panic together with failures encountered while joining execution or cleaning up. The original panic remains in Value.
func (*RunnerPanicError) Error ¶ added in v0.26.1
func (e *RunnerPanicError) Error() string
func (*RunnerPanicError) Unwrap ¶ added in v0.26.1
func (e *RunnerPanicError) Unwrap() []error
type Service ¶
Service represents updater
type StatementRunner ¶ added in v0.26.1
type StatementRunner struct {
// contains filtered or unexported fields
}
StatementRunner reuses at most one exact UPDATE shape within one callback. It must not be copied. It never owns transaction completion.
func (*StatementRunner) Exec ¶ added in v0.26.1
func (r *StatementRunner) Exec(ctx context.Context, service *Service, value any, options ...option.Option) (count int64, err error)
Exec preserves ordinary per-row binding, hooks, cancellation and guards. Concurrent/reentrant execution is rejected. Calls after the callback return ErrRunnerClosed. Nontransactional dialects and custom builders use ordinary, unretained statements.
func (*StatementRunner) Reset ¶ added in v0.26.1
func (r *StatementRunner) Reset() (err error)
Reset invalidates reuse at a SQL/DDL or queue barrier. It does not complete the transaction and is subject to the same serial admission as Exec.