db

package
v1.0.60 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MPL-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDbClient added in v1.0.58

type BaseDbClient struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func (*BaseDbClient) HCount added in v1.0.58

func (b *BaseDbClient) HCount() (int64, error)

func (*BaseDbClient) HGet added in v1.0.58

func (b *BaseDbClient) HGet(v any) error

func (*BaseDbClient) HQuery added in v1.0.58

func (b *BaseDbClient) HQuery(args ...*protobuf.ListParam) (*sqlx.Rows, error)

func (*BaseDbClient) HSelect added in v1.0.58

func (b *BaseDbClient) HSelect(v any, args ...*protobuf.ListParam) error

func (*BaseDbClient) Sq added in v1.0.58

func (*BaseDbClient) ToSql added in v1.0.58

func (b *BaseDbClient) ToSql() (string, []any, error)

type BaseDbProvider

type BaseDbProvider struct {
	Default *BaseDbClient            // 缺省的数据库连接
	Main    *BaseDbClient            // 主数据库连接,可读写
	Slaves  []*BaseDbClient          // 只读从数据库列表,只可读
	Items   map[string]*BaseDbClient // 额外数据库
}

func (*BaseDbProvider) By

func (*BaseDbProvider) Master

func (b *BaseDbProvider) Master() types.DbClient

func (*BaseDbProvider) My

func (b *BaseDbProvider) My() types.DbClient

func (*BaseDbProvider) Slave

func (b *BaseDbProvider) Slave(i int) types.DbClient

Directories

Path Synopsis
Package mysql @Title log capability of zerolog @Description zerolog implementation of log capability @Author Ryan Fan 2021-06-09 @Update Ryan Fan 2021-06-09
Package mysql @Title log capability of zerolog @Description zerolog implementation of log capability @Author Ryan Fan 2021-06-09 @Update Ryan Fan 2021-06-09

Jump to

Keyboard shortcuts

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