transaction

package
v6.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package transaction provides atomic transaction support for TableTheory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransactGet

func TransactGet(
	ctx context.Context,
	sess *session.Session,
	registry *model.Registry,
	converter *pkgTypes.Converter,
	requests []core.TransactGetRequest,
) ([]core.TransactGetResult, error)

TransactGet executes a DynamoDB TransactGetItems request against TableTheory models. The result slice preserves request order and reports missing items as Found=false instead of returning ErrItemNotFound.

Types

type Builder

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

Builder implements the core.TransactionBuilder interface.

func NewBuilder

func NewBuilder(sess *session.Session, registry *model.Registry, converter *pkgTypes.Converter) *Builder

NewBuilder creates a new transaction builder backed by the provided session, registry, and converter.

func (*Builder) ConditionCheck

func (b *Builder) ConditionCheck(model any, conditions ...core.TransactCondition) core.TransactionBuilder

ConditionCheck schedules a condition check.

func (*Builder) Create

func (b *Builder) Create(model any, conditions ...core.TransactCondition) core.TransactionBuilder

Create schedules a conditional put guarded by attribute_not_exists on the primary key.

func (*Builder) Delete

func (b *Builder) Delete(model any, conditions ...core.TransactCondition) core.TransactionBuilder

Delete schedules a delete operation.

func (*Builder) Execute

func (b *Builder) Execute() error

Execute commits the transaction using the builder's configured context.

func (*Builder) ExecuteWithContext

func (b *Builder) ExecuteWithContext(ctx context.Context) error

ExecuteWithContext commits the transaction with an explicit context override.

func (*Builder) Put

func (b *Builder) Put(model any, conditions ...core.TransactCondition) core.TransactionBuilder

Put schedules a put (upsert) operation.

func (*Builder) Update

func (b *Builder) Update(model any, fields []string, conditions ...core.TransactCondition) core.TransactionBuilder

Update schedules a partial update using the provided fields.

func (*Builder) UpdateWithBuilder

func (b *Builder) UpdateWithBuilder(model any, updateFn func(core.UpdateBuilder) error, conditions ...core.TransactCondition) core.TransactionBuilder

UpdateWithBuilder schedules a complex update using the UpdateBuilder DSL.

func (*Builder) WithContext

func (b *Builder) WithContext(ctx context.Context) core.TransactionBuilder

WithContext sets the execution context for the transaction.

type Transaction

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

Transaction represents a DynamoDB transaction

func NewTransaction

func NewTransaction(session *session.Session, registry *model.Registry, converter *pkgTypes.Converter) *Transaction

NewTransaction creates a new transaction

func (*Transaction) Commit

func (tx *Transaction) Commit() error

Commit executes the transaction

func (*Transaction) Create

func (tx *Transaction) Create(model any) (err error)

Create adds a create operation to the transaction

func (*Transaction) Delete

func (tx *Transaction) Delete(model any) (err error)

Delete adds a delete operation to the transaction

func (*Transaction) Get

func (tx *Transaction) Get(model any, dest any) error

Get adds a get operation to the transaction

func (*Transaction) Rollback

func (tx *Transaction) Rollback() error

Rollback cancels the transaction (no-op for DynamoDB)

func (*Transaction) Update

func (tx *Transaction) Update(model any) (err error)

Update adds an update operation to the transaction

func (*Transaction) WithContext

func (tx *Transaction) WithContext(ctx context.Context) *Transaction

WithContext sets the context for the transaction

Jump to

Keyboard shortcuts

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