postgresql

package
v0.0.0-...-a08de0b Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder(cfg juno.Config, codec *params.EncodingConfig) (db.Database, error)

Builder allows to create a new Db instance implementing the db.Builder type

Types

type Db

type Db struct {
	*database.Database
	Sqlx *sqlx.DB

	PartitionSize int
	// contains filtered or unexported fields
}

Db represents a PostgreSQL database with expanded features. so that it can properly store custom BigDipper-related data.

func Cast

func Cast(db db.Database) *Db

Cast allows to cast the given db to a Db instance

func (*Db) GetAddresses

func (db *Db) GetAddresses() ([]string, error)

GetAccounts returns all the addresses that are currently stored inside the database.

func (*Db) GetBlockHeightTimeDayAgo

func (db *Db) GetBlockHeightTimeDayAgo(now time.Time) (dbtypes.BlockRow, error)

GetBlockHeightTimeDayAgo return block height and time that a block proposals about a day (24hour) ago from input date

func (*Db) GetBlockHeightTimeHourAgo

func (db *Db) GetBlockHeightTimeHourAgo(now time.Time) (dbtypes.BlockRow, error)

GetBlockHeightTimeHourAgo return block height and time that a block proposals about a hour ago from input date

func (*Db) GetBlockHeightTimeMinuteAgo

func (db *Db) GetBlockHeightTimeMinuteAgo(now time.Time) (dbtypes.BlockRow, error)

GetBlockHeightTimeMinuteAgo return block height and time that a block proposals about a minute ago from input date

func (*Db) GetGenesis

func (db *Db) GetGenesis() (*types.Genesis, error)

GetGenesis returns the genesis information stored inside the database

func (*Db) GetLastBlock

func (db *Db) GetLastBlock() (*dbtypes.BlockRow, error)

GetLastBlock returns the last block stored inside the database based on the heights

func (*Db) GetLastBlockHeight

func (db *Db) GetLastBlockHeight() (int64, error)

GetLastBlockHeight returns the last block height stored inside the database

func (*Db) GetTokenUnits

func (db *Db) GetTokenUnits() ([]types.TokenUnit, error)

GetTokenUnits returns the slice of all the names of the different tokens units

func (*Db) IsStoreHistoricDataEnabled

func (db *Db) IsStoreHistoricDataEnabled() bool

IsStoreHistoricDataEnabled tells whether or not the historical data should be stored inside the database

func (*Db) SaveAccounts

func (db *Db) SaveAccounts(accounts []types.Account, height uint64) error

SaveAccounts saves the given accounts inside the database

func (*Db) SaveAverageBlockTimeGenesis

func (db *Db) SaveAverageBlockTimeGenesis(blocktime types.BlockTime) error

SaveAverageBlockTimeGenesis save the average block time in average_block_time_from_genesis table

func (*Db) SaveAverageBlockTimePerDay

func (db *Db) SaveAverageBlockTimePerDay(blocktime types.BlockTime) error

SaveAverageBlockTimePerDay save the average block time in average_block_time_per_day table

func (*Db) SaveAverageBlockTimePerHour

func (db *Db) SaveAverageBlockTimePerHour(blocktime types.BlockTime) error

SaveAverageBlockTimePerHour save the average block time in average_block_time_per_hour table

func (*Db) SaveAverageBlockTimePerMin

func (db *Db) SaveAverageBlockTimePerMin(blocktime types.BlockTime) error

SaveAverageBlockTimePerMin save the average block time in average_block_time_per_minute table

func (*Db) SaveCurrentTable

func (db *Db) SaveCurrentTable(currentTable types.CurrentTable) error

func (*Db) SaveCutPercentage

func (db *Db) SaveCutPercentage(cutPercentage types.CutPercentage) error

func (*Db) SaveDelegatorAccounts

func (db *Db) SaveDelegatorAccounts(accounts []types.DelegatorAccount) error

func (*Db) SaveDelegatorInfo

func (db *Db) SaveDelegatorInfo(delegatorInfo []types.DelegatorNodeInfo, height uint64) error

func (*Db) SaveGenesis

func (db *Db) SaveGenesis(genesis *types.Genesis) error

SaveGenesis save the given genesis data

func (*Db) SaveLockedAccount

func (db *Db) SaveLockedAccount(accounts []types.LockedAccount) error

func (*Db) SaveLockedAccountBalance

func (db *Db) SaveLockedAccountBalance(accounts []types.LockedAccountBalance) error

func (*Db) SaveNodeInfosFromTable

func (db *Db) SaveNodeInfosFromTable(nodeInfosFromTable []types.StakerNodeInfo, height uint64) error

func (*Db) SaveNodeTotalCommitment

func (db *Db) SaveNodeTotalCommitment(nodeTotalCommitment []types.NodeTotalCommitment) error

func (*Db) SaveNodeTotalCommitmentWithoutDelegators

func (db *Db) SaveNodeTotalCommitmentWithoutDelegators(nodeTotalCommitmentWithoutDelegators []types.NodeTotalCommitmentWithoutDelegators) error

func (*Db) SaveNodeUnstakingTokens

func (db *Db) SaveNodeUnstakingTokens(nodeUnstakingTokens []types.NodeUnstakingTokens) error

func (*Db) SaveProposedTable

func (db *Db) SaveProposedTable(proposedTable types.ProposedTable) error

func (*Db) SaveStakeRequirements

func (db *Db) SaveStakeRequirements(stakeRequirements []types.StakeRequirements) error

SaveStakeRequirements save the stake requirement from cadence call

func (*Db) SaveStakerNodeId

func (db *Db) SaveStakerNodeId(stakerNodeId []types.StakerNodeId) error

func (*Db) SaveStakingTable

func (db *Db) SaveStakingTable(stakingTable types.StakingTable) error

func (*Db) SaveSupply

func (db *Db) SaveSupply(supply uint64, height uint64) error

func (*Db) SaveToken

func (db *Db) SaveToken(token types.Token) error

SaveToken allows to save the given token details

func (*Db) SaveTokenPricesHistory

func (db *Db) SaveTokenPricesHistory(prices []types.TokenPrice) error

SaveTokenPricesHistory stores the given prices as historic ones

func (*Db) SaveTokensPrices

func (db *Db) SaveTokensPrices(prices []types.TokenPrice) error

SaveTokensPrices allows to save the given prices as the most updated ones

func (*Db) SaveTotalStake

func (db *Db) SaveTotalStake(totalStake types.TotalStake) error

func (*Db) SaveTotalStakeByType

func (db *Db) SaveTotalStakeByType(totalStake []types.TotalStakeByType) error

func (*Db) SaveWeeklyPayout

func (db *Db) SaveWeeklyPayout(weeklyPayout types.WeeklyPayout) error

Jump to

Keyboard shortcuts

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