Documentation
Overview ¶
Package ethdb defines the interfaces for an Ethereum data store.
Index ¶
- Constants
- Variables
- func Bytesmask(fixedbits int) (fixedbytes int, mask byte)
- func ForEach(c Cursor, walker func([]byte, []byte) (bool, error)) error
- func Get(db KV, bucket string, key []byte) ([]byte, error)
- func GetChangeSetByBlock(db Getter, storage bool, timestamp uint64) ([]byte, error)
- func GetModifiedAccounts(db Getter, startTimestamp, endTimestamp uint64) ([]common.Address, error)
- func HackAddRootToAccountBytes(accNoRoot []byte, root []byte) (accWithRoot []byte, err error)
- func InspectDatabase(db Database) error
- func MultiPut(tx Tx, tuples ...[]byte) error
- func MultiWalk(c Cursor, startkeys [][]byte, fixedbits []int, ...) error
- func NewBolt() boltOpts
- func NewLMDB() lmdbOpts
- func NewRemote() remoteOpts
- func NewSplitCursor(c Cursor, startkey []byte, matchBits int, part1end, part2start, part3start int) *splitCursor
- func RewindData(db Getter, timestampSrc, timestampDst uint64) (map[string][]byte, map[string][]byte, error)
- func RewindDataPlain(db Getter, timestampSrc, timestampDst uint64) (map[string][]byte, map[string][]byte, error)
- func SetStorageModeIfNotExist(db Database, sm StorageMode) error
- func Walk(c Cursor, startkey []byte, fixedbits int, ...) error
- type Backend
- type BoltKV
- func (db *BoltKV) AllBuckets() dbutils.BucketsCfg
- func (db *BoltKV) Begin(ctx context.Context, parent Tx, writable bool) (Tx, error)
- func (db *BoltKV) BucketsStat(_ context.Context) (map[string]common.StorageBucketWriteStats, error)
- func (db *BoltKV) Close()
- func (db *BoltKV) DiskSize(_ context.Context) (uint64, error)
- func (db *BoltKV) Update(ctx context.Context, f func(tx Tx) error) (err error)
- func (db *BoltKV) View(ctx context.Context, f func(tx Tx) error) (err error)
- type BucketConfigsFunc
- type BucketMigrator
- type Closer
- type Cursor
- type DBCounterStats
- type Database
- type DbProvider
- type DbWithPendingMutations
- type Deleter
- type Getter
- type GetterPutter
- type HasKV
- type HasNetInterface
- type HasStats
- type HasTx
- type Iteratee
- type Iterator
- type KV
- type LmdbCursor
- func (c *LmdbCursor) Append(key []byte, value []byte) error
- func (c *LmdbCursor) AppendDup(key []byte, value []byte) error
- func (c *LmdbCursor) Close() error
- func (c *LmdbCursor) Delete(key []byte) error
- func (c *LmdbCursor) First() ([]byte, []byte, error)
- func (c *LmdbCursor) Last() ([]byte, []byte, error)
- func (c *LmdbCursor) Next() (k, v []byte, err error)
- func (c *LmdbCursor) Prefetch(v uint) Cursor
- func (c *LmdbCursor) Prefix(v []byte) Cursor
- func (c *LmdbCursor) Put(key []byte, value []byte) error
- func (c *LmdbCursor) PutCurrent(key []byte, value []byte) error
- func (c *LmdbCursor) Seek(seek []byte) (k, v []byte, err error)
- func (c *LmdbCursor) SeekBothExact(key, value []byte) ([]byte, []byte, error)
- func (c *LmdbCursor) SeekBothRange(key, value []byte) ([]byte, []byte, error)
- func (c *LmdbCursor) SeekExact(key []byte) ([]byte, error)
- type LmdbKV
- func (db *LmdbKV) AllBuckets() dbutils.BucketsCfg
- func (db *LmdbKV) AllDBI() map[string]lmdb.DBI
- func (db *LmdbKV) Begin(ctx context.Context, parent Tx, writable bool) (Tx, error)
- func (db *LmdbKV) Close()
- func (db *LmdbKV) DiskSize(_ context.Context) (uint64, error)
- func (db *LmdbKV) Env() *lmdb.Env
- func (db *LmdbKV) Update(ctx context.Context, f func(tx Tx) error) (err error)
- func (db *LmdbKV) View(ctx context.Context, f func(tx Tx) error) (err error)
- type MinDatabase
- type MultiPutTuples
- type NoValuesCursor
- type NonTransactional
- type ObjectDatabase
- func (db *ObjectDatabase) Ancients() (uint64, error)
- func (db *ObjectDatabase) Append(bucket string, key []byte, value []byte) error
- func (db *ObjectDatabase) Begin() (DbWithPendingMutations, error)
- func (db *ObjectDatabase) BucketExists(name string) (bool, error)
- func (db *ObjectDatabase) ClearBuckets(buckets ...string) error
- func (db *ObjectDatabase) Close()
- func (db *ObjectDatabase) Delete(bucket string, key []byte) error
- func (db *ObjectDatabase) DiskSize(ctx context.Context) (uint64, error)
- func (db *ObjectDatabase) DropBuckets(buckets ...string) error
- func (db *ObjectDatabase) Get(bucket string, key []byte) ([]byte, error)
- func (db *ObjectDatabase) GetIndexChunk(bucket string, key []byte, timestamp uint64) ([]byte, error)
- func (db *ObjectDatabase) Has(bucket string, key []byte) (bool, error)
- func (db *ObjectDatabase) IdealBatchSize() int
- func (db *ObjectDatabase) KV() KV
- func (db *ObjectDatabase) Keys() ([][]byte, error)
- func (db *ObjectDatabase) Last(bucket string) ([]byte, []byte, error)
- func (db *ObjectDatabase) MemCopy() *ObjectDatabase
- func (db *ObjectDatabase) MultiPut(tuples ...[]byte) (uint64, error)
- func (db *ObjectDatabase) MultiWalk(bucket string, startkeys [][]byte, fixedbits []int, ...) error
- func (db *ObjectDatabase) NewBatch() DbWithPendingMutations
- func (db *ObjectDatabase) Put(bucket string, key []byte, value []byte) error
- func (db *ObjectDatabase) TruncateAncients(items uint64) error
- func (db *ObjectDatabase) Walk(bucket string, startkey []byte, fixedbits int, ...) error
- type Putter
- type RWCounterDecorator
- func (d *RWCounterDecorator) Delete(bucket string, key []byte) error
- func (d *RWCounterDecorator) Get(bucket string, key []byte) ([]byte, error)
- func (d *RWCounterDecorator) Has(bucket string, key []byte) (bool, error)
- func (d *RWCounterDecorator) MultiPut(tuples ...[]byte) (uint64, error)
- func (d *RWCounterDecorator) MultiWalk(bucket string, startkeys [][]byte, fixedbits []int, ...) error
- func (d *RWCounterDecorator) NewBatch() DbWithPendingMutations
- func (d *RWCounterDecorator) Put(bucket string, key, value []byte) error
- func (d *RWCounterDecorator) Walk(bucket string, startkey []byte, fixedbits int, ...) error
- type RemoteBackend
- type RemoteKV
- func (db *RemoteKV) AllBuckets() dbutils.BucketsCfg
- func (db *RemoteKV) Begin(ctx context.Context, parent Tx, writable bool) (Tx, error)
- func (db *RemoteKV) Close()
- func (db *RemoteKV) DiskSize(ctx context.Context) (uint64, error)
- func (db *RemoteKV) Update(ctx context.Context, f func(tx Tx) error) (err error)
- func (db *RemoteKV) View(ctx context.Context, f func(tx Tx) error) (err error)
- type StorageMode
- type Tx
- type TxDb
- func (m *TxDb) Ancients() (uint64, error)
- func (m *TxDb) Append(bucket string, key []byte, value []byte) error
- func (m *TxDb) BatchSize() int
- func (m *TxDb) Begin() (DbWithPendingMutations, error)
- func (m *TxDb) Close()
- func (m *TxDb) Commit() (uint64, error)
- func (m *TxDb) CommitAndBegin() error
- func (m *TxDb) Delete(bucket string, key []byte) error
- func (m *TxDb) DiskSize(ctx context.Context) (common.StorageSize, error)
- func (m *TxDb) Get(bucket string, key []byte) ([]byte, error)
- func (m *TxDb) GetIndexChunk(bucket string, key []byte, timestamp uint64) ([]byte, error)
- func (m *TxDb) Has(bucket string, key []byte) (bool, error)
- func (m *TxDb) IdealBatchSize() int
- func (m *TxDb) KV() KV
- func (m *TxDb) Keys() ([][]byte, error)
- func (m *TxDb) Last(bucket string) ([]byte, []byte, error)
- func (m *TxDb) MultiPut(tuples ...[]byte) (uint64, error)
- func (m *TxDb) MultiWalk(bucket string, startkeys [][]byte, fixedbits []int, ...) error
- func (m *TxDb) NewBatch() DbWithPendingMutations
- func (m *TxDb) Put(bucket string, key []byte, value []byte) error
- func (m *TxDb) Rollback()
- func (m *TxDb) TruncateAncients(items uint64) error
- func (m *TxDb) Tx() Tx
- func (m *TxDb) Walk(bucket string, startkey []byte, fixedbits int, ...) error
Constants ¶
const (
NonExistingDBI = 999_999_999
)
Variables ¶
var ( ErrAttemptToDeleteNonDeprecatedBucket = errors.New("only buckets from dbutils.DeprecatedBuckets can be deleted") ErrUnknownBucket = errors.New("unknown bucket. add it to dbutils.Buckets") )
var DefaultBucketConfigs = func(defaultBuckets dbutils.BucketsCfg) dbutils.BucketsCfg {
return defaultBuckets
}
var DefaultStorageMode = StorageMode{History: true, Receipts: true, TxIndex: true}
var EndSuffix = []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
var ErrKeyNotFound = errors.New("db: key not found")
ErrKeyNotFound is returned when key isn't found in the database.
var (
LMDBMapSize = 2 * datasize.TB
)
Functions ¶
func GetChangeSetByBlock ¶
func GetModifiedAccounts ¶
func InspectDatabase ¶
func NewSplitCursor ¶
func RewindData ¶
func RewindData(db Getter, timestampSrc, timestampDst uint64) (map[string][]byte, map[string][]byte, error)
RewindData generates rewind data for all buckets between the timestamp timestapSrc is the current timestamp, and timestamp Dst is where we rewind
func RewindDataPlain ¶
func RewindDataPlain(db Getter, timestampSrc, timestampDst uint64) (map[string][]byte, map[string][]byte, error)
RewindDataPlain generates rewind data for all plain buckets between the timestamp timestapSrc is the current timestamp, and timestamp Dst is where we rewind
func SetStorageModeIfNotExist ¶
func SetStorageModeIfNotExist(db Database, sm StorageMode) error
Types ¶
type BoltKV ¶
type BoltKV struct {
// contains filtered or unexported fields
}
func (*BoltKV) AllBuckets ¶
func (db *BoltKV) AllBuckets() dbutils.BucketsCfg
func (*BoltKV) BucketsStat ¶
func (*BoltKV) Close ¶
func (db *BoltKV) Close()
Close closes BoltKV All transactions must be closed before closing the database.
type BucketConfigsFunc ¶
type BucketConfigsFunc func(defaultBuckets dbutils.BucketsCfg) dbutils.BucketsCfg
type BucketMigrator ¶
type BucketMigrator interface { DropBucket(string) error CreateBucket(string) error ExistsBucket(string) bool ClearBucket(string) error ExistingBuckets() ([]string, error) }
Interface used for buckets migration, don't use it in usual app code
type Cursor ¶
type Cursor interface { Prefix(v []byte) Cursor Prefetch(v uint) Cursor First() ([]byte, []byte, error) Seek(seek []byte) ([]byte, []byte, error) SeekExact(key []byte) ([]byte, error) Next() ([]byte, []byte, error) Last() ([]byte, []byte, error) Put(key []byte, value []byte) error Delete(key []byte) error Append(key []byte, value []byte) error // Returns error if provided data not sorted or has duplicates }
type DBCounterStats ¶
type Database ¶
type Database interface { Getter Putter Deleter Closer // MultiPut inserts or updates multiple entries. // Entries are passed as an array: // bucket0, key0, val0, bucket1, key1, val1, ... MultiPut(tuples ...[]byte) (uint64, error) // NewBatch - starts in-mem batch // // Common pattern: // // batch := db.NewBatch() // defer batch.Rollback() // ... some calculations on `batch` // batch.Commit() // NewBatch() DbWithPendingMutations // Begin() (DbWithPendingMutations, error) // starts db transaction Last(bucket string) ([]byte, []byte, error) // IdealBatchSize defines the size of the data batches should ideally add in one write. IdealBatchSize() int Keys() ([][]byte, error) // [TURBO-GETH] Freezer support (minimum amount that is actually used) // FIXME: implement support if needed Ancients() (uint64, error) TruncateAncients(items uint64) error Append(bucket string, key, value []byte) error }
Database wraps all database operations. All methods are safe for concurrent use.
type DbWithPendingMutations ¶
type DbWithPendingMutations interface { Database // Commit - commits transaction (or flush data into underlying db object in case of `mutation`) // // Common pattern: // // tx := db.Begin() // defer tx.Rollback() // ... some calculations on `tx` // tx.Commit() // Commit() (uint64, error) // CommitAndBegin - commits and starts new transaction inside same db object. // useful for periodical commits implementation. // // Common pattern: // // tx := db.Begin() // defer tx.Rollback() // for { // ... some calculations on `tx` // tx.CommitAndBegin() // // defer here - is not useful, because 'tx' object is reused and first `defer` will work perfectly // } // tx.Commit() // CommitAndBegin() error Rollback() BatchSize() int }
DbWithPendingMutations is an extended version of the Database, where all changes are first made in memory. Later they can either be committed to the database or rolled back.
type Deleter ¶
type Deleter interface { // Delete removes a single entry. Delete(bucket string, key []byte) error }
Deleter wraps the database delete operations.
type Getter ¶
type Getter interface { // Get returns the value for a given key if it's present. Get(bucket string, key []byte) ([]byte, error) // Get returns prober chunk of index or error if index is not created. // Key must contain 8byte inverted block number in the end. GetIndexChunk(bucket string, key []byte, timestamp uint64) ([]byte, error) // Has indicates whether a key exists in the database. Has(bucket string, key []byte) (bool, error) // Walk iterates over entries with keys greater or equal to startkey. // Only the keys whose first fixedbits match those of startkey are iterated over. // walker is called for each eligible entry. // If walker returns false or an error, the walk stops. Walk(bucket string, startkey []byte, fixedbits int, walker func(k, v []byte) (bool, error)) error // MultiWalk is similar to multiple Walk calls folded into one. MultiWalk(bucket string, startkeys [][]byte, fixedbits []int, walker func(int, []byte, []byte) error) error }
Getter wraps the database read operations.
type GetterPutter ¶
type HasNetInterface ¶
type HasNetInterface interface {
DB() Database
}
type Iteratee ¶
type Iteratee interface { // NewIterator creates a binary-alphabetical iterator over a subset // of database content with a particular key prefix, starting at a particular // initial key (or after, if it does not exist). // // Note: This method assumes that the prefix is NOT part of the start, so there's // no need for the caller to prepend the prefix to the start NewIterator(prefix []byte, start []byte) Iterator }
Iteratee wraps the NewIterator methods of a backing data store.
type Iterator ¶
type Iterator interface { // Next moves the iterator to the next key/value pair. It returns whether the // iterator is exhausted. Next() bool // Error returns any accumulated error. Exhausting all the key/value pairs // is not considered to be an error. Error() error // Key returns the key of the current key/value pair, or nil if done. The caller // should not modify the contents of the returned slice, and its contents may // change on the next call to Next. Key() []byte // Value returns the value of the current key/value pair, or nil if done. The // caller should not modify the contents of the returned slice, and its contents // may change on the next call to Next. Value() []byte // Release releases associated resources. Release should always succeed and can // be called multiple times without causing error. Release() }
Iterator iterates over a database's key/value pairs in ascending key order.
When it encounters an error any seek will return false and will yield no key/ value pairs. The error can be queried by calling the Error method. Calling Release is still necessary.
An iterator must be released after use, but it is not necessary to read an iterator until exhaustion. An iterator is not safe for concurrent use, but it is safe to use multiple iterators concurrently.
type LmdbCursor ¶
type LmdbCursor struct {
// contains filtered or unexported fields
}
func (*LmdbCursor) Append ¶
func (c *LmdbCursor) Append(key []byte, value []byte) error
Append - speedy feature of lmdb which is not part of KV interface. Cast your cursor to *LmdbCursor to use this method. Danger: if provided data will not sorted (or bucket have old records which mess with new in sorting manner) - db will corrupt.
func (*LmdbCursor) Close ¶
func (c *LmdbCursor) Close() error
func (*LmdbCursor) Delete ¶
func (c *LmdbCursor) Delete(key []byte) error
func (*LmdbCursor) Next ¶
func (c *LmdbCursor) Next() (k, v []byte, err error)
func (*LmdbCursor) Prefetch ¶
func (c *LmdbCursor) Prefetch(v uint) Cursor
func (*LmdbCursor) Prefix ¶
func (c *LmdbCursor) Prefix(v []byte) Cursor
func (*LmdbCursor) PutCurrent ¶
func (c *LmdbCursor) PutCurrent(key []byte, value []byte) error
func (*LmdbCursor) SeekBothExact ¶
func (c *LmdbCursor) SeekBothExact(key, value []byte) ([]byte, []byte, error)
func (*LmdbCursor) SeekBothRange ¶
func (c *LmdbCursor) SeekBothRange(key, value []byte) ([]byte, []byte, error)
type LmdbKV ¶
type LmdbKV struct {
// contains filtered or unexported fields
}
func (*LmdbKV) AllBuckets ¶
func (db *LmdbKV) AllBuckets() dbutils.BucketsCfg
func (*LmdbKV) Close ¶
func (db *LmdbKV) Close()
Close closes db All transactions must be closed before closing the database.
type MinDatabase ¶
type MinDatabase interface { Get(bucket string, key []byte) ([]byte, error) Put(bucket string, key, value []byte) error Delete(bucket string, key []byte) error }
MinDatabase is a minimalistic version of the Database interface.
type MultiPutTuples ¶
type MultiPutTuples [][]byte
Type which expecting sequence of triplets: dbi, key, value, .... It sorts entries by dbi name, then inside dbi clusters sort by keys
func (MultiPutTuples) Len ¶
func (t MultiPutTuples) Len() int
func (MultiPutTuples) Less ¶
func (t MultiPutTuples) Less(i, j int) bool
func (MultiPutTuples) Swap ¶
func (t MultiPutTuples) Swap(i, j int)
type NoValuesCursor ¶
type NonTransactional ¶
type ObjectDatabase ¶
type ObjectDatabase struct {
// contains filtered or unexported fields
}
ObjectDatabase - is an object-style interface of DB accessing
func MustOpen ¶
func MustOpen(path string) *ObjectDatabase
func NewDatabaseWithFreezer ¶
func NewDatabaseWithFreezer(db *ObjectDatabase, dir, suffix string) (*ObjectDatabase, error)
func NewMemDatabase ¶
func NewMemDatabase() *ObjectDatabase
func NewObjectDatabase ¶
func NewObjectDatabase(kv KV) *ObjectDatabase
NewObjectDatabase returns a AbstractDB wrapper.
func Open ¶
func Open(path string) (*ObjectDatabase, error)
Open - main method to open database. Choosing driver based on path suffix. If env TEST_DB provided - choose driver based on it. Some test using this method to open non-in-memory db
func (*ObjectDatabase) Ancients ¶
func (db *ObjectDatabase) Ancients() (uint64, error)
[TURBO-GETH] Freezer support (not implemented yet) Ancients returns an error as we don't have a backing chain freezer.
func (*ObjectDatabase) Append ¶
func (db *ObjectDatabase) Append(bucket string, key []byte, value []byte) error
Append appends a single entry to the end of the bucket.
func (*ObjectDatabase) Begin ¶
func (db *ObjectDatabase) Begin() (DbWithPendingMutations, error)
func (*ObjectDatabase) BucketExists ¶
func (db *ObjectDatabase) BucketExists(name string) (bool, error)
func (*ObjectDatabase) ClearBuckets ¶
func (db *ObjectDatabase) ClearBuckets(buckets ...string) error
func (*ObjectDatabase) Close ¶
func (db *ObjectDatabase) Close()
func (*ObjectDatabase) Delete ¶
func (db *ObjectDatabase) Delete(bucket string, key []byte) error
Delete deletes the key from the queue and database
func (*ObjectDatabase) DiskSize ¶
func (db *ObjectDatabase) DiskSize(ctx context.Context) (uint64, error)
func (*ObjectDatabase) DropBuckets ¶
func (db *ObjectDatabase) DropBuckets(buckets ...string) error
func (*ObjectDatabase) Get ¶
func (db *ObjectDatabase) Get(bucket string, key []byte) ([]byte, error)
Get returns the value for a given key if it's present.
func (*ObjectDatabase) GetIndexChunk ¶
func (db *ObjectDatabase) GetIndexChunk(bucket string, key []byte, timestamp uint64) ([]byte, error)
GetIndexChunk returns proper index chunk or return error if index is not created. key must contain inverted block number in the end
func (*ObjectDatabase) IdealBatchSize ¶
func (db *ObjectDatabase) IdealBatchSize() int
IdealBatchSize defines the size of the data batches should ideally add in one write.
func (*ObjectDatabase) KV ¶
func (db *ObjectDatabase) KV() KV
func (*ObjectDatabase) Keys ¶
func (db *ObjectDatabase) Keys() ([][]byte, error)
func (*ObjectDatabase) MemCopy ¶
func (db *ObjectDatabase) MemCopy() *ObjectDatabase
func (*ObjectDatabase) MultiPut ¶
func (db *ObjectDatabase) MultiPut(tuples ...[]byte) (uint64, error)
MultiPut - requirements: input must be sorted and without duplicates
func (*ObjectDatabase) NewBatch ¶
func (db *ObjectDatabase) NewBatch() DbWithPendingMutations
func (*ObjectDatabase) Put ¶
func (db *ObjectDatabase) Put(bucket string, key []byte, value []byte) error
Put inserts or updates a single entry.
func (*ObjectDatabase) TruncateAncients ¶
func (db *ObjectDatabase) TruncateAncients(items uint64) error
TruncateAncients returns an error as we don't have a backing chain freezer.
type Putter ¶
type Putter interface { // Put inserts or updates a single entry. Put(bucket string, key, value []byte) error }
Putter wraps the database write operations.
type RWCounterDecorator ¶
type RWCounterDecorator struct { Database DBCounterStats }
func NewRWDecorator ¶
func NewRWDecorator(db Database) *RWCounterDecorator
func (*RWCounterDecorator) Delete ¶
func (d *RWCounterDecorator) Delete(bucket string, key []byte) error
func (*RWCounterDecorator) Get ¶
func (d *RWCounterDecorator) Get(bucket string, key []byte) ([]byte, error)
func (*RWCounterDecorator) Has ¶
func (d *RWCounterDecorator) Has(bucket string, key []byte) (bool, error)
func (*RWCounterDecorator) MultiPut ¶
func (d *RWCounterDecorator) MultiPut(tuples ...[]byte) (uint64, error)
func (*RWCounterDecorator) NewBatch ¶
func (d *RWCounterDecorator) NewBatch() DbWithPendingMutations
type RemoteBackend ¶
type RemoteBackend struct {
// contains filtered or unexported fields
}
func (*RemoteBackend) AddLocal ¶
func (back *RemoteBackend) AddLocal(signedTx []byte) ([]byte, error)
func (*RemoteBackend) NetVersion ¶
func (back *RemoteBackend) NetVersion() (uint64, error)
type RemoteKV ¶
type RemoteKV struct {
// contains filtered or unexported fields
}
func (*RemoteKV) AllBuckets ¶
func (db *RemoteKV) AllBuckets() dbutils.BucketsCfg
func (*RemoteKV) Close ¶
func (db *RemoteKV) Close()
Close All transactions must be closed before closing the database.
type StorageMode ¶
func GetStorageModeFromDB ¶
func GetStorageModeFromDB(db Database) (StorageMode, error)
func StorageModeFromString ¶
func StorageModeFromString(flags string) (StorageMode, error)
func (StorageMode) ToString ¶
func (m StorageMode) ToString() string
type TxDb ¶
type TxDb struct { ParentTx Tx // contains filtered or unexported fields }
TxDb - provides Database interface around ethdb.Tx It's not thread-safe! TxDb not usable after .Commit()/.Rollback() call, but usable after .CommitAndBegin() call you can put unlimited amount of data into this class, call IdealBatchSize is unnecessary Walk and MultiWalk methods - work outside of Tx object yet, will implement it later
func NewTxDbWithoutTransaction ¶
NewTxDbWithoutTransaction creates TxDb object without opening transaction, such TxDb not usable before .Begin() call on it It allows inject TxDb object into class hierarchy, but open write transaction later
func (*TxDb) Ancients ¶
[TURBO-GETH] Freezer support (not implemented yet) Ancients returns an error as we don't have a backing chain freezer.
func (*TxDb) Begin ¶
func (m *TxDb) Begin() (DbWithPendingMutations, error)
func (*TxDb) CommitAndBegin ¶
func (*TxDb) GetIndexChunk ¶
func (*TxDb) IdealBatchSize ¶
IdealBatchSize defines the size of the data batches should ideally add in one write.
func (*TxDb) NewBatch ¶
func (m *TxDb) NewBatch() DbWithPendingMutations
func (*TxDb) TruncateAncients ¶
TruncateAncients returns an error as we don't have a backing chain freezer.
Source Files
Directories
Path | Synopsis |
---|---|
Code generated by go generate; DO NOT EDIT.
|
Code generated by go generate; DO NOT EDIT. |