batch

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Text string `yaml:"text"`
	// Inclusive start position of the batch in the original script, starting from 0 and calculated by byte offset.
	Start int `yaml:"start"`
	// Exclusive end position of the batch in the original script, starting from 0 and calculated by byte offset.
	End int `yaml:"end"`
}

Batch is a batch of Transact-SQL statements.

type Batcher

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

func NewBatcher

func NewBatcher(statement string) *Batcher

NewBatcher returns a new Batch.

func (*Batcher) Batch

func (b *Batcher) Batch() *Batch

Batch returns the current SQL batch text.

func (*Batcher) Next

func (b *Batcher) Next() (Command, error)

Next returns the next command in the batch.

func (*Batcher) Reset

func (b *Batcher) Reset(r []rune)

Reset clears the current batch text and replaces it with new runes.

type Command

type Command interface {
	// String returns the string representation of the command.
	String() string
}

type GoCommand

type GoCommand struct {
	// Count is a positive integer, the batch preceding the GO command will execute the specified number of times.
	// The default value of Count is 1.
	Count uint
}

GoCommand signals the end of a batch of Transact-SQL statements to the SQL Server Utilities. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go?view=sql-server-ver16

func (*GoCommand) String

func (g *GoCommand) String() string

String returns the string representation of the command.

Jump to

Keyboard shortcuts

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