sql

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableAddressUpdates = "address_updates"
	TableTxs            = "txs"
	TableInputs         = "inputs"
	TableOutputs        = "outputs"
	TableBlocks         = "blocks"
	TableBlockTxs       = "block_txs"
	TableSlpBatons      = "slp_batons"
	TableSlpGeneses     = "slp_geneses"
	TableSlpOutputs     = "slp_outputs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	Prefix string
	Db     *sql.DB
}

func NewDatabase

func NewDatabase(db *sql.DB, prefix string) (*Database, error)

func (*Database) GetAddressBalance

func (d *Database) GetAddressBalance(addresses []wallet.Addr) (*lib.Balance, error)

func (*Database) GetAddressLastUpdate

func (d *Database) GetAddressLastUpdate(addresses []wallet.Addr) ([]graph.AddressUpdate, error)

func (*Database) GetInsert

func (d *Database) GetInsert(table string, values map[string]interface{}) *Query

func (*Database) GetTableName

func (d *Database) GetTableName(table string) string

func (*Database) GetUtxos

func (d *Database) GetUtxos(addresses []wallet.Addr) ([]graph.Output, error)

func (*Database) SaveTxs

func (d *Database) SaveTxs(txs []graph.Tx) error

func (*Database) SetAddressLastUpdate

func (d *Database) SetAddressLastUpdate(lastUpdates []graph.AddressUpdate) error

type Query

type Query struct {
	Name      string
	Query     string
	Variables []interface{}
}

type Table

type Table struct {
	Name    string
	Columns map[string]string
	Indexes []string
}

func (Table) GetDefinition

func (t Table) GetDefinition(prefix string) string

func (Table) GetInsert

func (t Table) GetInsert(prefix string, values map[string]interface{}) Query

func (Table) GetName

func (t Table) GetName(prefix string) string

Jump to

Keyboard shortcuts

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