Help us shape the future of Go! Take the 2026 Go Developer Survey

sequence

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock added in v0.26.1

type Lock struct{}

Lock acquires database write intent before sequence identity reads. It uses the supplied transaction exclusively and never completes it. SQLite permits only one writer; a concurrent invocation waits here until that owner finishes.

func (*Lock) CanUse added in v0.26.1

func (*Lock) CanUse(...interface{}) bool

func (*Lock) Handle added in v0.26.1

func (*Lock) Handle(ctx context.Context, db *sql.DB, _ interface{}, opts ...interface{}) (bool, error)

type Max

type Max struct{}

Max represents struct used to setting new autoincrement value using simple "SELECT MAX(ID)" approach

func (*Max) CanUse

func (n *Max) CanUse(iopts ...interface{}) bool

CanUse returns true if Handle function can be executed

func (*Max) Handle

func (n *Max) Handle(ctx context.Context, db *sql.DB, target interface{}, iopts ...interface{}) (doNext bool, err error)

Handle sets new autoincrement value using simple "SELECT MAX(ID)" approach

type Metadata added in v0.26.0

type Metadata struct{}

Metadata owns read-only physical sequence identity for SQLite. A numeric MAX allocation may target a table with no sqlite_sequence entry yet.

func (*Metadata) CanUse added in v0.26.0

func (n *Metadata) CanUse(options ...interface{}) bool

func (*Metadata) Handle added in v0.26.0

func (n *Metadata) Handle(ctx context.Context, db *sql.DB, target interface{}, opts ...interface{}) (bool, error)

type Next added in v0.2.2

type Next struct{}

Next reserves a durable SQLite range without inserting entity rows. A supplied transaction retains completion ownership; its reservation is pending until that owner commits. MAX allocation remains a separate read-only strategy.

func (*Next) CanUse added in v0.2.2

func (n *Next) CanUse(opts ...interface{}) bool

func (*Next) Handle added in v0.2.2

func (n *Next) Handle(ctx context.Context, db *sql.DB, target interface{}, opts ...interface{}) (bool, error)

type Reserve added in v0.26.1

type Reserve struct{}

Reserve adapts the existing durable SQLite range owner to exact values.

func (*Reserve) CanUse added in v0.26.1

func (*Reserve) CanUse(...interface{}) bool

func (*Reserve) Handle added in v0.26.1

func (*Reserve) Handle(ctx context.Context, db *sql.DB, target interface{}, opts ...interface{}) (bool, error)

Jump to

Keyboard shortcuts

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