_rd

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Conf *struct {
		Database map[string]*struct {
			Count   int `json:"count"`
			Cluster map[string]*struct {
				Master *struct {
					Count   int        `json:"count"`
					Machine []*Machine `json:"machine"`
				} `json:"master"`
				Slaver *struct {
					Count   int        `json:"count"`
					Machine []*Machine `json:"machine"`
				} `json:"slaver"`
			} `json:"cluster"`
		} `json:"database"`
		Table map[string]int `json:"table"`
	}
)

Functions

This section is empty.

Types

type Machine

type Machine struct {
	Driver    string `json:"driver"`
	Host      string `json:"host"`
	Port      string `json:"port"`
	Database  string `json:"database"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	Charset   string `json:"charset"`
	Collation string `json:"collation"`
	Pool      *sql.DB
}

type Rd

type Rd struct {
	// contains filtered or unexported fields
}

func New

func New(baseDatabase string, baseTable string) *Rd

func (*Rd) Add

func (this *Rd) Add(row map[string]interface{}) int64

func (*Rd) Begin

func (this *Rd) Begin() *Rd

func (*Rd) Commit

func (this *Rd) Commit() *Rd

func (*Rd) Count

func (this *Rd) Count() int64

func (*Rd) DatabaseIndex

func (this *Rd) DatabaseIndex(databaseIndex int) *Rd

func (*Rd) Del

func (this *Rd) Del() int64

func (*Rd) Execute

func (this *Rd) Execute(sql string, add bool) int64

func (*Rd) Exists

func (this *Rd) Exists() bool

func (*Rd) Field

func (this *Rd) Field(field string) *Rd

func (*Rd) Get

func (this *Rd) Get() map[string]string

func (*Rd) GetList

func (this *Rd) GetList() []map[string]string

func (*Rd) Group

func (this *Rd) Group(group string) *Rd

func (*Rd) Index

func (this *Rd) Index(index string) *Rd

func (*Rd) Limit

func (this *Rd) Limit(limit int) *Rd

func (*Rd) Master

func (this *Rd) Master() *Rd

func (*Rd) Offset

func (this *Rd) Offset(offset int) *Rd

func (*Rd) Order

func (this *Rd) Order(order string) *Rd

func (*Rd) Parameter

func (this *Rd) Parameter(parameter ...interface{}) *Rd

func (*Rd) Query

func (this *Rd) Query(sql string) []map[string]string

func (*Rd) Rollback

func (this *Rd) Rollback() *Rd

func (*Rd) Set

func (this *Rd) Set(row map[string]interface{}) int64

func (*Rd) Shard

func (this *Rd) Shard() *Rd

func (*Rd) TableIndex

func (this *Rd) TableIndex(tableIndex int) *Rd

func (*Rd) Tx

func (this *Rd) Tx(rd *Rd) *Rd

func (*Rd) Where

func (this *Rd) Where(where string) *Rd

Jump to

Keyboard shortcuts

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