Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
Types ¶
type Context ¶
type Context interface {
Transaction() Transaction
Parent() Context
Resources() any
}
func NewContext ¶
func NewContext() Context
type Executor ¶
type Executor interface {
Execute(ctx context.Context, fn Func) (any, error)
ExecutorInTransaction(ctx context.Context, fn Func, options ...Option) (any, error)
TransactionManager() Manager
}
func NewExecutor ¶
type IsolationLevel ¶
type IsolationLevel int
const ( LevelDefault IsolationLevel = iota LevelReadUncommitted LevelReadCommitted LevelWriteCommitted LevelRepeatableRead LevelSnapshot LevelSerializable LevelLinearizable )
type Manager ¶
type Option ¶
type Option func(options *Options)
func WithIsolation ¶
func WithIsolation(isolationLevel IsolationLevel) Option
func WithPropagation ¶
func WithPropagation(propagation Propagation) Option
func WithReadOnly ¶
func WithTimeout ¶
type Options ¶
type Options struct {
Propagation Propagation
Timeout time.Duration
ReadOnly bool
IsolationLevel IsolationLevel
}
func DefaultOptions ¶
func DefaultOptions() *Options
func NewOptions ¶
func WithOptions ¶
type Propagation ¶
type Propagation int
const ( PropagationRequired Propagation = iota PropagationSupports PropagationMandatory PropagationNever PropagationNotSupported PropagationNested PropagationRequiredNew )
type Template ¶
type Template interface {
Exec(query string, args ...any) (sql.Result, error)
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
Prepare(query string) (*sql.Stmt, error)
PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
Query(query string, args ...any) (*sql.Rows, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *sql.Row
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}
Click to show internal directories.
Click to hide internal directories.