Documentation ¶
Overview ¶
Package addresses provides functions and SQL framents for working with the "addresses" table, which stores factom.FAAddress with its balance.
Index ¶
- Constants
- func Add(conn *sqlite.Conn, adr *factom.FAAddress, add uint64) (int64, error)
- func InsertTransactionRelation(conn *sqlite.Conn, adrID int64, entryID int64, to bool) (int64, error)
- func SelectCount(conn *sqlite.Conn, nonZeroOnly bool) (int64, error)
- func SelectID(conn *sqlite.Conn, adr *factom.FAAddress) (int64, error)
- func SelectIDBalance(conn *sqlite.Conn, adr *factom.FAAddress) (adrID int64, bal uint64, err error)
- func Sub(conn *sqlite.Conn, adr *factom.FAAddress, sub uint64) (id int64, txErr, err error)
Constants ¶
const CreateTable = `` /* 243-byte string literal not displayed */
CreateTable is a SQL string that creates the "addresses" table.
const CreateTableTransactions = `` /* 512-byte string literal not displayed */
CreateTableTransactions is a SQL string that creates the "address_transactions" table.
The "address_transactions" table has a foreign key reference to the "addresses" and "entries" tables, which must exist first.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add adds add to the balance of adr, creating a new row in "addresses" if it does not exist. If successful, the row id of adr is returned.
func InsertTransactionRelation ¶
func InsertTransactionRelation(conn *sqlite.Conn, adrID int64, entryID int64, to bool) (int64, error)
InsertTransactionRelation inserts a row into "address_transactions" relating the adrID with the entryID with the given transaction direction, to. If successful, the row id for the new row in "address_transactions" is returned.
func SelectCount ¶
SelectCount returns the number of rows in "addresses". If nonZeroOnly is true, then only count the addresses with a non zero balance.
func SelectIDBalance ¶
SelectIDBalance returns the row id and balance for the given adr.
Types ¶
This section is empty.