autoincrement

package
Version: v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAutoIncrement

func GetAutoIncrement(node *sqlparser.DDL) (*config.AutoIncrement, error)

GetAutoIncrement -- used to get config AutoIncrement from 'create table' DDL sqlnode.

Types

type AutoIncrement

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

AutoIncrement struct. Using Now().UnixNano as start seed seq.

func (*AutoIncrement) Close

func (autoinc *AutoIncrement) Close() error

Close -- close the plugin.

func (*AutoIncrement) Init

func (autoinc *AutoIncrement) Init() error

Init -- used to init the plug module.

func (*AutoIncrement) Process

func (autoinc *AutoIncrement) Process(database string, ins *sqlparser.Insert) error

Process -- process auto-increment. Append the auto-increment column&value to the end of the row if not exists.

type AutoIncrementHandler

type AutoIncrementHandler interface {
	Init() error
	Process(database string, ins *sqlparser.Insert) error
	Close() error
}

func NewAutoIncrement

func NewAutoIncrement(log *xlog.Log, router *router.Router) AutoIncrementHandler

NewAutoIncrement -- creates new AutoIncrement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL