sequence

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 Next added in v0.2.2

type Next struct{}

Next represents struct used to setting new autoincrement value using insert inside new transaction finished by rollback

func (*Next) CanUse added in v0.2.2

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

CanUse returns true if Handle function can be executed

func (*Next) Handle added in v0.2.2

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

Handle sets new autoincrement value by inserting row using new transaction finished by rollback, uses locking

Jump to

Keyboard shortcuts

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