dbHelper

package
v0.0.0-...-29f768c Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DELETE_DATA = `DELETE FROM student WHERE age>=30`
View Source
var DELETE_TABLE = `DROP TABLE student;`
View Source
var INSERT_DATA = `INSERT INTO account_info(base58,wif,balance_ont,balance_wing,staking_amount) VALUES(?,?,?,?,?);`
View Source
var INSERT_WING_DIS_RES = `INSERT INTO wing_dis_result_borrow VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?,?);`
View Source
var INSERT_WING_DIS_RES2 = `INSERT INTO wing_dis_result_supply VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,  ?,?);`
View Source
var QUERY_Addr = `SELECT * FROM account_info WHERE base58=?;`
View Source
var QUERY_DATA = `SELECT * FROM account_info limit ?,?;`
View Source
var UPDATE_DATA = `UPDATE account_info SET balance_wing=? WHERE base58=?;`
View Source
var UPDATE_Staking = `UPDATE account_info SET staking_amount=? WHERE base58=?;`

Functions

func CreateTable

func CreateTable(db *sql.DB, sql string)

创建表

func Delete

func Delete(db *sql.DB)

删除记录

func DeleteTable

func DeleteTable(db *sql.DB)

删除表

func Insert

func Insert(db *sql.DB, base58 string, wif string, balance_ont int, balance_wing int, staking_amount int)

插入数据

func InsertWingDisRes

func InsertWingDisRes(db *sql.DB, market_name, user_addr, market_addr string, total_valid_borrow, user_valid_borrow, wing_speed, exp_res, rel_res *big.Int, start_time, end_time uint32, err_rate *big.Float)

插入数据

func InsertWingDisRes4Borrow

func InsertWingDisRes4Borrow(db *gorm.DB, market_name, user_addr, market_addr string, total_valid_borrow, user_valid_borrow, wing_speed, exp_res, rel_res *big.Int, start_time, end_time uint32, err_rate *big.Float)

func InsertWingDisRes4Supply

func InsertWingDisRes4Supply(db *sql.DB, market_name, user_addr, market_addr string, total_valid_borrow, user_valid_borrow, wing_speed, exp_res, rel_res *big.Int, start_time, end_time uint32, err_rate *big.Float)

插入数据

func Query

func Query(db *sql.DB, start, end int) *sql.Rows

查询数据

func QueryAccountFromDb

func QueryAccountFromDb(start, end int) []*goSdk.Account

func QueryAccountFromDbByBase58

func QueryAccountFromDbByBase58(address string) []*goSdk.Account

func QueryByAddr

func QueryByAddr(db *sql.DB, addr string) *sql.Rows

查询数据

func SetupConnect

func SetupConnect() *sql.DB

建立数据库连接

func Update

func Update(db *sql.DB, wing_balance uint64, base58 string) (sql.Result, error)

修改数据

func UpdateStakingBalance

func UpdateStakingBalance(db *sql.DB, wing_balance uint64, base58 string) (sql.Result, error)

修改数据

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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