types

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUpdateBatch

func NewUpdateBatch() protocol.StoreBatcher

NewUpdateBatch constructs an instance of a Batch

Types

type EngineType

type EngineType int32

EngineType database type

const (
	UnknownDb EngineType = 0
	LevelDb   EngineType = 1
	TikvDb    EngineType = 2
	MySQL     EngineType = 3
	Sqlite    EngineType = 4
	BadgerDb  EngineType = 5
)

nolint

func (EngineType) LowerString

func (t EngineType) LowerString() string

func (EngineType) String

func (t EngineType) String() string

type HistoryIteratorImpl

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

func NewHistoryIterator

func NewHistoryIterator(contractName string, key []byte, dbItr historydb.HistoryIterator,
	resultStore resultdb.ResultDB, blockStore blockdb.BlockDB) *HistoryIteratorImpl

func (*HistoryIteratorImpl) Next

func (hs *HistoryIteratorImpl) Next() bool

func (*HistoryIteratorImpl) Release

func (hs *HistoryIteratorImpl) Release()

func (*HistoryIteratorImpl) Value

type SavePoint

type SavePoint struct {
	BlockHeight uint64 `gorm:"primarykey"`
}

func (*SavePoint) GetCountSql

func (b *SavePoint) GetCountSql() (string, []interface{})

func (*SavePoint) GetCreateTableSql

func (b *SavePoint) GetCreateTableSql(dbType string) string

func (*SavePoint) GetInsertSql

func (b *SavePoint) GetInsertSql() (string, []interface{})

func (*SavePoint) GetTableName

func (b *SavePoint) GetTableName() string

func (*SavePoint) GetUpdateSql

func (b *SavePoint) GetUpdateSql() (string, []interface{})

type SqlVerifyPass

type SqlVerifyPass struct {
}

SqlVerifyPass 用于测试场景,不对SQL语句进行检查,任意SQL检查都通过

func (*SqlVerifyPass) VerifyDDLSql

func (s *SqlVerifyPass) VerifyDDLSql(sql string) error

func (*SqlVerifyPass) VerifyDMLSql

func (s *SqlVerifyPass) VerifyDMLSql(sql string) error

func (*SqlVerifyPass) VerifyDQLSql

func (s *SqlVerifyPass) VerifyDQLSql(sql string) error

type StandardSqlVerify

type StandardSqlVerify struct {
}

StandardSqlVerify 如果状态数据库是标准SQL语句,对标准SQL的SQL语句进行语法检查,不关心具体的SQL DB类型的语法差异

func (*StandardSqlVerify) VerifyDDLSql

func (s *StandardSqlVerify) VerifyDDLSql(sql string) error

func (*StandardSqlVerify) VerifyDMLSql

func (s *StandardSqlVerify) VerifyDMLSql(sql string) error

func (*StandardSqlVerify) VerifyDQLSql

func (s *StandardSqlVerify) VerifyDQLSql(sql string) error

type TxHistoryIteratorImpl

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

func NewTxHistoryIterator

func NewTxHistoryIterator(dbItr historydb.HistoryIterator, blockStore blockdb.BlockDB) *TxHistoryIteratorImpl

func (*TxHistoryIteratorImpl) Next

func (hs *TxHistoryIteratorImpl) Next() bool

func (*TxHistoryIteratorImpl) Release

func (hs *TxHistoryIteratorImpl) Release()

func (*TxHistoryIteratorImpl) Value

func (hs *TxHistoryIteratorImpl) Value() (*storePb.TxHistory, error)

type UpdateBatch

type UpdateBatch struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

UpdateBatch encloses the details of multiple `updates`

func (*UpdateBatch) Delete

func (batch *UpdateBatch) Delete(key []byte)

Delete deletes a Key and associated value

func (*UpdateBatch) Get added in v2.1.1

func (batch *UpdateBatch) Get(key []byte) ([]byte, error)

func (*UpdateBatch) Has added in v2.1.1

func (batch *UpdateBatch) Has(key []byte) bool

func (*UpdateBatch) KVs

func (batch *UpdateBatch) KVs() map[string][]byte

KVs return map

func (*UpdateBatch) Len

func (batch *UpdateBatch) Len() int

Len returns the number of entries in the batch

func (*UpdateBatch) Merge

func (batch *UpdateBatch) Merge(u protocol.StoreBatcher)

Merge merges other kvs to this updateBatch

func (*UpdateBatch) Put

func (batch *UpdateBatch) Put(key []byte, value []byte)

Put adds a KV

func (*UpdateBatch) SplitBatch

func (batch *UpdateBatch) SplitBatch(batchCnt uint64) []protocol.StoreBatcher

SplitBatch split other kvs to more updateBatchs division by batchCnt

Jump to

Keyboard shortcuts

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