postgresql

package
v0.0.0-...-3b09c4e Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: CC0-1.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder(ctx *db.Context) (db.Database, error)

Builder creates a database connection with the given database connection info from config. It returns a database connection handle or an error if the connection fails.

Types

type Database

type Database struct {
	Sql            *sql.DB
	EncodingConfig *params.EncodingConfig
	Logger         logging.Logger
}

Database defines a wrapper around a SQL database and implements functionality for data aggregation and exporting.

func (*Database) Close

func (db *Database) Close()

Close implements db.Database

func (*Database) GetLastPruned

func (db *Database) GetLastPruned() (int64, error)

GetLastPruned implements db.PruningDb

func (*Database) HasBlock

func (db *Database) HasBlock(height int64) (bool, error)

HasBlock implements db.Database

func (*Database) HasValidator

func (db *Database) HasValidator(addr string) (bool, error)

HasValidator implements db.Database

func (*Database) LastBlockHeight

func (db *Database) LastBlockHeight() (int64, error)

LastBlockHeight implements db.Database

func (*Database) Prune

func (db *Database) Prune(height int64) error

Prune implements db.PruningDb

func (*Database) SaveBlock

func (db *Database) SaveBlock(block *types.Block) error

SaveBlock implements db.Database

func (*Database) SaveCommitSignatures

func (db *Database) SaveCommitSignatures(signatures []*types.CommitSig) error

SaveCommitSignatures implements db.Database

func (*Database) SaveMessage

func (db *Database) SaveMessage(msg *types.Message) error

SaveMessage implements db.Database

func (*Database) SaveTx

func (db *Database) SaveTx(tx *types.Tx) error

SaveTx implements db.Database

func (*Database) SaveValidators

func (db *Database) SaveValidators(validators []*types.Validator) error

SaveValidators implements db.Database

func (*Database) StoreLastPruned

func (db *Database) StoreLastPruned(height int64) error

StoreLastPruned implements db.PruningDb

Jump to

Keyboard shortcuts

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