Documentation ¶
Index ¶
- Variables
- type MysqlIni
- type Mysqlcon
- func (that *Mysqlcon) BeginStart() bool
- func (that *Mysqlcon) Build_where() (string, []interface{})
- func (that *Mysqlcon) CheckConnectStatus()
- func (that *Mysqlcon) Check_PK(fdname string) bool
- func (that *Mysqlcon) Check_data_fields(fieldname string) bool
- func (that *Mysqlcon) Commit()
- func (that *Mysqlcon) Count() int64
- func (that *Mysqlcon) Dbinit()
- func (that *Mysqlcon) Delete() (sql.Result, error)
- func (that *Mysqlcon) Excute(sqltext string, param []interface{}) (sql.Result, error)
- func (that *Mysqlcon) Fileds(name string) *Mysqlcon
- func (that *Mysqlcon) Find() map[string]string
- func (that *Mysqlcon) GetLastSql() string
- func (that *Mysqlcon) GetWherePostFrom(postdata map[string]interface{}, masterdb string) map[string]interface{}
- func (that *Mysqlcon) Get_fields_sql(fd_name, val_name string) (result string)
- func (db *Mysqlcon) Get_mysql_dict(tbname string)
- func (that *Mysqlcon) Get_new_add() map[string]string
- func (that *Mysqlcon) Get_read_dbcon() *sql.DB
- func (that *Mysqlcon) Get_select_data(d_data map[string]string, masterdb string) map[string]string
- func (that *Mysqlcon) Get_where_data(postdata map[string]interface{}) map[string]interface{}
- func (that *Mysqlcon) IMax(fd string) int64
- func (that *Mysqlcon) IMin(fd string) int64
- func (that *Mysqlcon) Init_Redis_Struct()
- func (that *Mysqlcon) Insert(postdata map[string]interface{}) (sql.Result, error)
- func (that *Mysqlcon) Join(tbname string, jointype string, where string, fileds string) *Mysqlcon
- func (that *Mysqlcon) Limit(limitstr string) *Mysqlcon
- func (that *Mysqlcon) Max(fd string) float64
- func (that *Mysqlcon) Merge_And_where(where_str, new_str string) string
- func (that *Mysqlcon) Merge_OR_where(where_str, new_str string) string
- func (that *Mysqlcon) Min(fd string) float64
- func (that *Mysqlcon) Order(orderstr string) *Mysqlcon
- func (that *Mysqlcon) Query(sqltext string, param []interface{}) []map[string]string
- func (that *Mysqlcon) Query_One(sqltext string, param []interface{}) map[string]string
- func (that *Mysqlcon) Rollback()
- func (that *Mysqlcon) Select() []map[string]string
- func (that *Mysqlcon) SetDec(fdname string, quantity int) (sql.Result, error)
- func (that *Mysqlcon) SetInc(fdname string, quantity int) (sql.Result, error)
- func (that *Mysqlcon) SetPK(pkfd string) *Mysqlcon
- func (that *Mysqlcon) SetWhere(where string, param ...interface{}) *Mysqlcon
- func (that *Mysqlcon) Sum(fd string) float64
- func (that *Mysqlcon) Tbname(name string) *Mysqlcon
- func (that *Mysqlcon) Type2str(val interface{}) string
- func (that *Mysqlcon) Update(postdata map[string]interface{}) (sql.Result, error)
- func (that *Mysqlcon) Update_redis(tbname string)
- func (that *Mysqlcon) Where(where interface{}) *Mysqlcon
Constants ¶
This section is empty.
Variables ¶
View Source
var G_dbtables map[string]interface{}
View Source
var G_fd_dict map[string]interface{}
View Source
var G_fd_list map[string]interface{}
View Source
var G_tb_dict map[string]interface{}
Functions ¶
This section is empty.
Types ¶
type MysqlIni ¶
type MysqlIni struct { DbUser string `json:"db_user"` DbPassword string `json:"db_password"` DbHost string `json:"db_host"` DbPort string `json:"db_port"` DbName string `json:"db_name"` DbMaxpool int `json:"db_maxpool"` DbMinpool int `json:"db_minpool"` DbPerfix string `json:"db_perfix"` Slavedb []string `json:"slavedb"` Maxtime int `json:"maxtime"` }
var G_MysqlIni MysqlIni
type Mysqlcon ¶
type Mysqlcon struct { Masterdb *sql.DB Slavedb []*sql.DB Db_host string Db_port string Db_name string Db_password string SqlTx *sql.Tx Slock sync.RWMutex Sql_param []interface{} Tablename string Sql_where string Sql_order string Sql_fields string Sql_limit string Db_perfix string PRK_editfd string Query_data []map[string]interface{} Join_arr map[string]string LastSqltext string ActionName string }
var G_Dbcon *Mysqlcon
func NewMySql_Server_DB ¶
func NewMySql_Server_DB() *Mysqlcon
func NewMysqlDB ¶
func (*Mysqlcon) BeginStart ¶
func (*Mysqlcon) Build_where ¶
func (*Mysqlcon) CheckConnectStatus ¶
func (that *Mysqlcon) CheckConnectStatus()
func (*Mysqlcon) Check_data_fields ¶
func (*Mysqlcon) GetLastSql ¶
func (*Mysqlcon) GetWherePostFrom ¶
func (*Mysqlcon) Get_fields_sql ¶
func (*Mysqlcon) Get_mysql_dict ¶
func (*Mysqlcon) Get_new_add ¶
func (*Mysqlcon) Get_read_dbcon ¶
func (*Mysqlcon) Get_select_data ¶
func (*Mysqlcon) Get_where_data ¶
func (*Mysqlcon) Init_Redis_Struct ¶
func (that *Mysqlcon) Init_Redis_Struct()
func (*Mysqlcon) Join ¶
func (that *Mysqlcon) delete(fields ...string) (*Mysqlcon) { that.Tokens = append(that.Tokens, "SELECT", strings.Join(fields,","))
return qb }
func (*Mysqlcon) Merge_And_where ¶
func (*Mysqlcon) Merge_OR_where ¶
func (*Mysqlcon) Update_redis ¶
Click to show internal directories.
Click to hide internal directories.