dbtx

package
v0.0.0-...-9742f5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginTx

func BeginTx(ctx context.Context) (context.Context, *sql.Tx, error)

BeginTx begins a transaction from the DB stored in ctx, or errors if either there is no DB, or a transaction is already in progress.

func ContextWithExecutor

func ContextWithExecutor(ctx context.Context, db boil.ContextExecutor) context.Context

ContextWithExecutor injects a ContextExecutor into a context.

func ExecutorFromContext

func ExecutorFromContext(ctx context.Context) boil.ContextExecutor

ExecutorFromContext retrieves the ContextExecutor from a context. If there is none set, nil is returned - boil will panic if that happens, but since this is a programming error (a failure to set a ContextExecutor on a BackgroundContext), it is a reasonable tradeoff given the frequency with which ExecutorFromContext is used.

Types

type DBInjector

type DBInjector struct {
	// contains filtered or unexported fields
}

DBInjector provides context injectors

func NewInjector

func NewInjector(db *sql.DB) *DBInjector

func (*DBInjector) StreamServerInterceptor

func (i *DBInjector) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*DBInjector) UnaryServerInterceptor

func (i *DBInjector) UnaryServerInterceptor() grpc.UnaryServerInterceptor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL