sequence

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLSequence

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

MySQLSequence struct of sequence number with specific sequence name

func NewMySQLSequence

func NewMySQLSequence(slice *backend.Slice, seqName, pkName string) *MySQLSequence

NewMySQLSequence init sequence item TODO: 直接注入slice需要考虑关闭的问题, 目前是在Namespace中管理Slice的关闭的. 如果单独使用MySQLSequence, 需要注意.

func (*MySQLSequence) GetPKName

func (s *MySQLSequence) GetPKName() string

GetPKName return sequence column

func (*MySQLSequence) NextSeq

func (s *MySQLSequence) NextSeq() (int64, error)

NextSeq get next sequence number

type Sequence

type Sequence interface {
	GetPKName() string
	NextSeq() (int64, error)
}

Sequence is interface of global sequences with different types

type SequenceManager

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

func NewSequenceManager

func NewSequenceManager() *SequenceManager

func (*SequenceManager) GetSequence

func (s *SequenceManager) GetSequence(db, table string) (Sequence, bool)

func (*SequenceManager) SetSequence

func (s *SequenceManager) SetSequence(db, table string, seq Sequence) error

Jump to

Keyboard shortcuts

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