sqldb

package
v2.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2016 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(file string) (*sql.DB, error)

Types

type SQLDB

type SQLDB struct {
	// contains filtered or unexported fields
}

func NewSQLiteDatabase

func NewSQLiteDatabase(file string) (*SQLDB, error)

NewSQLiteDatabase returns a sqlite3 wrapped object. sqlite3 does not persist data by it self but requires a background poller which syncs every X. `Flush` should be called when data needs to be stored and written to disk.

func (*SQLDB) Close

func (self *SQLDB) Close()

func (*SQLDB) DB

func (self *SQLDB) DB() *sql.DB

func (*SQLDB) DeleteBlock

func (self *SQLDB) DeleteBlock(block *types.Block)

func (*SQLDB) InsertBlock

func (self *SQLDB) InsertBlock(block *types.Block)

func (*SQLDB) Refresh

func (self *SQLDB) Refresh(chainManager pow.ChainManager)

func (*SQLDB) SelectTransactionsForAccounts

func (self *SQLDB) SelectTransactionsForAccounts(accounts []string) (trans SQL_Transactions, err error)

type SQL_Transaction

type SQL_Transaction struct {
	Hash        string
	BlockNumber uint64
}

func NewTransaction

func NewTransaction(hash string, blocknumber uint64) *SQL_Transaction

func (*SQL_Transaction) MarshalJSON

func (self *SQL_Transaction) MarshalJSON() ([]byte, error)

type SQL_Transactions

type SQL_Transactions []*SQL_Transaction

Jump to

Keyboard shortcuts

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