postgresql

package
v0.0.0-...-cdf0fd8 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: CC0-1.0 Imports: 8 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
	// 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) 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) IsStoreHistoricDataEnabled

func (db *Db) IsStoreHistoricDataEnabled() bool

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

func (*Db) SaveAccount

func (db *Db) SaveAccount(account []types.Account) error

func (*Db) SaveAccountContract

func (db *Db) SaveAccountContract(accountContract []types.AccountContract, address string) error

func (*Db) SaveAccountNft

func (db *Db) SaveAccountNft(accountNft []types.NFT, address string) error

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) SaveGenesis

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

SaveGenesis save the given genesis data

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) SaveSmartContractResult

func (db *Db) SaveSmartContractResult(smartContractResult []types.SmartContractResult, txHash string) error

func (*Db) SaveStakeRequirements

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

SaveStakeRequirements save the stake requirement from cadence call

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

func (*Db) SaveTokenBalance

func (db *Db) SaveTokenBalance(tokenBalance []types.Token, address string) error

func (*Db) SaveTotalStake

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

func (*Db) SaveTotalStakeByType

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

func (*Db) SaveTxs

func (db *Db) SaveTxs(transaction types.Txs) 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