db

package
v1.0.63 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: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDbProvider

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

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

type SqDbClient added in v1.0.63

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

func (*SqDbClient) HCount added in v1.0.63

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

func (*SqDbClient) HGet added in v1.0.63

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

func (*SqDbClient) HQuery added in v1.0.63

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

func (*SqDbClient) HSelect added in v1.0.63

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

func (*SqDbClient) Sq added in v1.0.63

func (b *SqDbClient) Sq(builder squirrel.Sqlizer) types.DbClient

func (*SqDbClient) Sqrl added in v1.0.63

func (b *SqDbClient) Sqrl(builder sqrl.Sqlizer) types.DbClient

func (*SqDbClient) ToSql added in v1.0.63

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

type SqrlDbClient added in v1.0.63

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

func (*SqrlDbClient) HCount added in v1.0.63

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

func (*SqrlDbClient) HGet added in v1.0.63

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

func (*SqrlDbClient) HQuery added in v1.0.63

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

func (*SqrlDbClient) HSelect added in v1.0.63

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

func (*SqrlDbClient) ToSql added in v1.0.63

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

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