postgresql

package
v0.0.0-...-7b2af25 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDatabase

func ConnectDatabase(ctx *database.DatabaseContext) (database.Database, error)

ConnectDatabase creates database connection with configuration set inside config.yaml file. It returns a database connection handle or an error if the connection fails.

Types

type Database

type Database struct {
	SQL *sqlx.DB
}

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 database.Database

func (*Database) GetTokensPriceID

func (db *Database) GetTokensPriceID() ([]string, error)

GetTokensPriceID returns the slice of prices id for all tokens stored inside database

func (*Database) SaveIBCToken

func (db *Database) SaveIBCToken(token types.IBCToken) error

SaveIBCToken allows to save the given IBC token details inside database

func (*Database) SaveTokens

func (db *Database) SaveTokens(token []types.ChainRegistryAsset) error

SaveTokens allows to save the given tokens details inside database

func (*Database) SaveTokensPrices

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

SaveTokensPrices allows to store the latest tokens price inside database

Jump to

Keyboard shortcuts

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