Documentation
¶
Index ¶
Constants ¶
View Source
const ( TableEffects = "effects" TableLedgerheaders = "ledgerheaders" TableActions = "actions" TableTransactions = "transactions" )
View Source
const ( DBTypeSQLite3 = "sqlite3" DBTypeMySQL = "mysql" // use it or not, who knows )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
ActionID uint64 `db:"actionid"`
Typei int `db:"typei"`
Type string `db:"type"`
LedgerSeq string `db:"ledgerseq"`
TxHash string `db:"txhash"`
FromAccount sql.NullString `db:"fromaccount"`
ToAccount sql.NullString `db:"toaccount"`
CreateAt uint64 `db:"createat"`
JData string `db:"jdata"`
}
Action object for db
type Database ¶
type Database interface {
Init(dbname string, cfg *config.Config, logger *zap.Logger) error
Close()
GetInitSQLs() (qt, qi []string)
PrepareTables(ctsqls, cisqls []string) error
Insert(table string, fields []Feild) (sql.Result, error)
Delete(table string, where []Where) (sql.Result, error)
Update(table string, toupdate []Feild, where []Where) (sql.Result, error)
SelectRows(table string, where []Where, order *Order, paging *Paging, result interface{}) error
SelectRowsOffset(table string, where []Where, order *Order, offset, limit uint64, result interface{}) error
SelectRawSQL(table string, sqlStr string, values []interface{}, result interface{}) error
SelectRowsUnion(table string, wheres [][]Where, order *Order, paging *Paging, result interface{}) error
Excute(stmt *sql.Stmt, fields []Feild) (sql.Result, error)
Prepare(table string, fields []Feild) (*sql.Stmt, error)
Begin() error
Commit() error
Rollback() error
}
Database interface for delos app database-operation
type Effect ¶
type Effect struct {
EffectID uint64 `db:"effectid"`
Typei int `db:"typei"`
Type string `db:"type"`
LedgerSeq string `db:"ledgerseq"`
TxHash string `db:"txhash"`
ActionID uint64 `db:"actionid"`
Account string `db:"account"`
CreateAt uint64 `db:"createat"`
JData string `db:"jdata"`
}
Effect object for db
type LedgerHeader ¶
type LedgerHeader struct {
LedgerID uint64 `db:"ledgerid"`
Sequence string `db:"sequence"`
Hash string `db:"hash"`
PrevHash string `db:"prevhash"`
StateRoot string `db:"stateroot"`
TransactionCount uint64 `db:"transactioncount"`
OperactionCount uint64 `db:"operactioncount"`
ClosedAt time.Time `db:"closedat"`
TotalCoins string `db:"totalcoins"`
FeePool string `db:"feepool"`
BaseFee string `db:"basefee"`
BaseReserve string `db:"basereserve"`
InflationSeq uint64 `db:"inflationseq"`
MaxTxSetSize uint64 `db:"maxtxsetsize"`
}
LedgerHeader object for db
type Paging ¶
type TxData ¶
type TxData struct {
TxID uint64 `db:"txid"`
TxHash string `db:"txhash"`
BlockHeight uint64 `db:"blockheight"`
BlockHash string `db:"blockhash"`
ActionCount uint32 `db:"actioncount"`
ActionID uint32 `db:"actionid"`
Src string `db:"src"`
Dst string `db:"dst"`
Nonce uint64 `db:"nonce"`
Amount string `db:"amount"`
ResultCode uint `db:"resultcode"`
ResultMsg string `db:"resultmsg"`
CreateAt uint64 `db:"createdat"`
JData string `db:"jdata"`
Memo string `db:"memo"`
}
TxData object for db
Click to show internal directories.
Click to hide internal directories.