gydblib

package
v0.0.0-...-2ec961a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 Mysqlcon

type Mysqlcon struct {
	Masterdb                *sql.DB
	Slavedb                 []*sql.DB
	Db_host                 string
	Db_port                 string
	Db_name                 string
	Db_password             string
	Db_Split, Db_SplitCount int
	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 Get_New_Main_DB

func Get_New_Main_DB() *Mysqlcon

func NewMySql_Server_DB

func NewMySql_Server_DB(action string) *Mysqlcon

func (*Mysqlcon) BeginStart

func (this *Mysqlcon) BeginStart() bool

func (*Mysqlcon) Build_where

func (this *Mysqlcon) Build_where() (string, []interface{})

func (*Mysqlcon) CheckConnectStatus

func (this *Mysqlcon) CheckConnectStatus()

func (*Mysqlcon) Check_PK

func (this *Mysqlcon) Check_PK(fdname string) bool

func (*Mysqlcon) Check_data_fields

func (this *Mysqlcon) Check_data_fields(fieldname string) bool

func (*Mysqlcon) Commit

func (this *Mysqlcon) Commit()

func (*Mysqlcon) Count

func (this *Mysqlcon) Count() int64

func (*Mysqlcon) Dbinit

func (this *Mysqlcon) Dbinit()

* 初始化结构

func (*Mysqlcon) Delete

func (this *Mysqlcon) Delete() (sql.Result, error)

func (*Mysqlcon) Excute

func (this *Mysqlcon) Excute(sqltext string, param []interface{}) (sql.Result, error)

func (*Mysqlcon) Fileds

func (this *Mysqlcon) Fileds(name string) *Mysqlcon

func (*Mysqlcon) Find

func (this *Mysqlcon) Find() map[string]string

func (*Mysqlcon) GetLastSql

func (this *Mysqlcon) GetLastSql() string

func (*Mysqlcon) GetWherePostFrom

func (this *Mysqlcon) GetWherePostFrom(postdata map[string]interface{}, masterdb string) map[string]interface{}

func (*Mysqlcon) Get_fields_sql

func (this *Mysqlcon) Get_fields_sql(fd_name, val_name string) (result string)

func (*Mysqlcon) Get_mysql_dict

func (db *Mysqlcon) Get_mysql_dict(tbname string)

func (*Mysqlcon) Get_new_add

func (this *Mysqlcon) Get_new_add() map[string]string

func (*Mysqlcon) Get_read_dbcon

func (this *Mysqlcon) Get_read_dbcon() *sql.DB

func (*Mysqlcon) Get_select_data

func (this *Mysqlcon) Get_select_data(d_data map[string]string, masterdb string) map[string]string

func (*Mysqlcon) Get_where_data

func (this *Mysqlcon) Get_where_data(postdata map[string]interface{}) map[string]interface{}

func (*Mysqlcon) IMax

func (this *Mysqlcon) IMax(fd string) int64

func (*Mysqlcon) IMin

func (this *Mysqlcon) IMin(fd string) int64

func (*Mysqlcon) Init_Redis_Struct

func (this *Mysqlcon) Init_Redis_Struct()

func (*Mysqlcon) Insert

func (this *Mysqlcon) Insert(postdata map[string]interface{}) (sql.Result, error)

func (*Mysqlcon) Join

func (this *Mysqlcon) Join(tbname string, jointype string, where string, fileds string) *Mysqlcon
func (this *Mysqlcon) delete(fields ...string) (*Mysqlcon) {
	this.Tokens = append(this.Tokens, "SELECT", strings.Join(fields,","))
	return qb
}

func (*Mysqlcon) Limit

func (this *Mysqlcon) Limit(limitstr string) *Mysqlcon

func (*Mysqlcon) Max

func (this *Mysqlcon) Max(fd string) float64

func (*Mysqlcon) Merge_And_where

func (this *Mysqlcon) Merge_And_where(where_str, new_str string) string

func (*Mysqlcon) Merge_OR_where

func (this *Mysqlcon) Merge_OR_where(where_str, new_str string) string

func (*Mysqlcon) Min

func (this *Mysqlcon) Min(fd string) float64

func (*Mysqlcon) Order

func (this *Mysqlcon) Order(orderstr string) *Mysqlcon

func (*Mysqlcon) Query

func (this *Mysqlcon) Query(sqltext string, param []interface{}) []map[string]string

func (*Mysqlcon) Query_One

func (this *Mysqlcon) Query_One(sqltext string, param []interface{}) map[string]string

func (*Mysqlcon) Rollback

func (this *Mysqlcon) Rollback()

func (*Mysqlcon) Select

func (this *Mysqlcon) Select() []map[string]string

func (*Mysqlcon) SetDec

func (this *Mysqlcon) SetDec(fdname string, quantity int) (sql.Result, error)

func (*Mysqlcon) SetInc

func (this *Mysqlcon) SetInc(fdname string, quantity int) (sql.Result, error)

func (*Mysqlcon) SetPK

func (this *Mysqlcon) SetPK(pkfd string) *Mysqlcon

func (*Mysqlcon) SetWhere

func (this *Mysqlcon) SetWhere(where string, param ...interface{}) *Mysqlcon

func (*Mysqlcon) Sum

func (this *Mysqlcon) Sum(fd string) float64

func (*Mysqlcon) Tbname

func (this *Mysqlcon) Tbname(name string) *Mysqlcon

设置数据表

func (*Mysqlcon) Type2str

func (this *Mysqlcon) Type2str(val interface{}) string

func (*Mysqlcon) Update

func (this *Mysqlcon) Update(postdata map[string]interface{}) (sql.Result, error)

func (*Mysqlcon) Update_redis

func (this *Mysqlcon) Update_redis(tbname string)

func (*Mysqlcon) Where

func (this *Mysqlcon) Where(where interface{}) *Mysqlcon

Jump to

Keyboard shortcuts

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