transaction

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package transaction provides transaction planning and lock analysis for migration squashing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockConflict

type LockConflict struct {
	Statement1     types.Statement
	Statement2     types.Statement
	ConflictType   string
	Severity       string
	Recommendation string
}

LockConflict represents a potential lock conflict between statements

type TransactionBatch

type TransactionBatch struct {
	Statements       []types.Statement
	RequiresNoTxn    bool
	MaxLockLevel     types.LockLevel
	EstimatedTime    types.ExecutionTimeCategory
	BatchNumber      int
	CanRunInParallel bool
}

TransactionBatch represents a group of statements that can run in a single transaction

type TransactionPlan

type TransactionPlan struct {
	Batches         []TransactionBatch
	TotalStatements int
	TotalBatches    int
	ConcurrentOps   int
	LockConflicts   []LockConflict
	Warnings        []string
}

TransactionPlan represents the complete execution plan for migrations

type TransactionPlanner

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

TransactionPlanner plans transaction boundaries and analyzes lock conflicts

func NewTransactionPlanner

func NewTransactionPlanner(pgVersion string) *TransactionPlanner

NewTransactionPlanner creates a new transaction planner

func (*TransactionPlanner) FormatLockAnalysis

func (tp *TransactionPlanner) FormatLockAnalysis(statements []types.Statement) string

FormatLockAnalysis formats detailed lock analysis for all statements

func (*TransactionPlanner) FormatPlan

func (tp *TransactionPlanner) FormatPlan(plan *TransactionPlan) string

FormatPlan formats the transaction plan for display

func (*TransactionPlanner) PlanTransactions

func (tp *TransactionPlanner) PlanTransactions(statements []types.Statement) *TransactionPlan

PlanTransactions creates an execution plan for a set of statements

Jump to

Keyboard shortcuts

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