transaction

package
v0.0.0-...-36085eb Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithBaseSqalxNode

func ContextWithBaseSqalxNode(ctx context.Context, node sqalx.Node) context.Context

ContextWithBaseSqalxNode returns a new context with the sqalx node set to the provided one

Types

type WrappingContext

type WrappingContext struct {
	context.Context
	sqalx.Node
}

WrappingContext combines a transaction and a context

func Begin

func Begin(ctx context.Context) (*WrappingContext, error)

Begin begins a new transaction and returns a transaction.WrappingContext that is the transaction and the context with the new sqalx transaction node. The caller must use the returned context in subsequent function calls that are meant to happen within the transaction.

func (*WrappingContext) WithoutTx

func (ctx *WrappingContext) WithoutTx() context.Context

WithoutTx returns this context with a top-level sqalx node that is outside of any ongoing transaction

Jump to

Keyboard shortcuts

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