gymsdb

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 Mscon

type Mscon struct {
	Db_host          string
	Db_port          string
	Db_name          string
	Db_password      string
	Db_perfix        string
	Masterdb         *sql.DB
	Slavedb          []*sql.DB
	SqlTx            *sql.Tx
	Slock            sync.Mutex
	Where_param      []interface{}
	Tablename        string
	Sql_where        string
	Sql_order        string
	Sql_fields       string
	Sql_limit        string
	PageSize, PageNo int
	Query_data       []map[string]interface{}
	Join_arr         map[string]string
	LastSqltext      string
}

func NewMsSql_Server_Con

func NewMsSql_Server_Con(action string) *Mscon

func (*Mscon) BeginStart

func (this *Mscon) BeginStart() bool

func (*Mscon) Build_page_sql

func (this *Mscon) Build_page_sql() (string, []interface{})

func (*Mscon) Build_where

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

func (*Mscon) Check_data_fields

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

func (*Mscon) Commit

func (this *Mscon) Commit()

func (*Mscon) Count

func (this *Mscon) Count() int64

func (*Mscon) Dbinit

func (this *Mscon) Dbinit()

func (*Mscon) Delete

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

func (*Mscon) Excute

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

func (*Mscon) Find

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

func (*Mscon) GetLastSql

func (this *Mscon) GetLastSql() string

func (*Mscon) GetRow

func (this *Mscon) GetRow(sqltext string, param []interface{}) map[string]string

func (*Mscon) Get_Fileds_sql

func (this *Mscon) Get_Fileds_sql(tbname string) string

func (*Mscon) Get_Tbname_Sql

func (this *Mscon) Get_Tbname_Sql() (string, []interface{})

func (*Mscon) Get_new_add

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

func (*Mscon) Get_read_dbcon

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

func (*Mscon) Get_where_data

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

func (*Mscon) Insert

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

func (*Mscon) Limit

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

func (*Mscon) MapContains

func (this *Mscon) MapContains(src map[string]interface{}, key string) bool

func (*Mscon) MapContains_str

func (this *Mscon) MapContains_str(src map[string]string, key string) bool

func (*Mscon) Order

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

func (*Mscon) PageSet

func (this *Mscon) PageSet(pagesize, pageno int) *Mscon

func (*Mscon) Query

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

func (*Mscon) QueryOne

func (this *Mscon) QueryOne() map[string]interface{}

func (*Mscon) QueryPage

func (this *Mscon) QueryPage() []map[string]interface{}

func (*Mscon) Rollback

func (this *Mscon) Rollback()

func (*Mscon) Select

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

func (*Mscon) SetDec

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

func (*Mscon) SetFields

func (this *Mscon) SetFields(src string) *Mscon

func (*Mscon) SetInc

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

func (*Mscon) SetWhere

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

func (*Mscon) Sum

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

func (*Mscon) Tbname

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

func (*Mscon) Update

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

func (*Mscon) Update_redis

func (this *Mscon) Update_redis(tbname string)

func (*Mscon) Where

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

Jump to

Keyboard shortcuts

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