db

package
v1.0.79 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 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 BaseDbClient added in v1.0.58

type BaseDbClient struct {
	*sqlx.DB
}

func (*BaseDbClient) Db added in v1.0.64

func (b *BaseDbClient) Db() *sqlx.DB

func (*BaseDbClient) Sq added in v1.0.58

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

func (*BaseDbClient) Sqrl added in v1.0.64

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

func (*BaseDbClient) ToSql added in v1.0.58

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

func (*BaseDbClient) XCount added in v1.0.64

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

func (*BaseDbClient) XGet added in v1.0.64

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

func (*BaseDbClient) XQuery added in v1.0.64

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

func (*BaseDbClient) XSelect added in v1.0.64

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

type BaseDbProvider

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

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 SqrlClient added in v1.0.64

type SqrlClient struct {
	*BaseDbClient
	// contains filtered or unexported fields
}

func (*SqrlClient) ToSql added in v1.0.64

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

func (*SqrlClient) XCount added in v1.0.64

func (b *SqrlClient) XCount() (int64, error)

func (*SqrlClient) XGet added in v1.0.64

func (b *SqrlClient) XGet(v any) error

func (*SqrlClient) XQuery added in v1.0.64

func (b *SqrlClient) XQuery(args ...*protobuf.ListParam) (*sqlx.Rows, error)

func (*SqrlClient) XSelect added in v1.0.64

func (b *SqrlClient) XSelect(v any, args ...*protobuf.ListParam) error

type SqurrelClient added in v1.0.64

type SqurrelClient struct {
	*BaseDbClient
	// contains filtered or unexported fields
}

func (*SqurrelClient) ToSql added in v1.0.64

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

func (*SqurrelClient) XCount added in v1.0.64

func (b *SqurrelClient) XCount() (int64, error)

func (*SqurrelClient) XGet added in v1.0.64

func (b *SqurrelClient) XGet(v any) error

func (*SqurrelClient) XQuery added in v1.0.64

func (b *SqurrelClient) XQuery(args ...*protobuf.ListParam) (*sqlx.Rows, error)

func (*SqurrelClient) XSelect added in v1.0.64

func (b *SqurrelClient) XSelect(v any, args ...*protobuf.ListParam) 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