transaction

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	BeginRoTransaction(ctx context.Context, f func(ctx context.Context, tx Transaction) error, opts ...Option) error
	BeginRwTransaction(ctx context.Context, f func(ctx context.Context, tx Transaction) error, opts ...Option) error
	Close() error
}

Connection は、データベースとの物理的な接続を表すインターフェースです。

type Option

type Option func(*Options)

func WithIsolationLevel

func WithIsolationLevel(l sql.IsolationLevel) Option

WithIsolationLevel は、トランザクション分離レベルを設定するオプションです。

type Options

type Options struct {
	IsolationLevel sql.IsolationLevel
}

func DefaultOptions

func DefaultOptions() Options

type Transaction

type Transaction = *sql.Tx

Jump to

Keyboard shortcuts

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