BaseDBManager

package
v5.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLClient

type SQLClient struct {
	//DB数据库句柄
	DB CoreSQL2.Client
	//表名称
	// eg: base_db_manager
	TableName string
	//主表缓冲标识码前缀
	// eg: xxx:xxx:xxx
	CacheName string
	//默认缓冲时效性
	// eg: 3600
	CacheTime int
	//结构映射关系
	// eg: &FieldsXXX{}
	FieldsAny any
	//是否存在更新时间
	HaveUpdateTime bool
	//是否存在软删除
	HaveSoftDelete bool
}

func (*SQLClient) Create

func (t *SQLClient) Create(params map[string]any) (id int64, err error)

Create 创建数据

func (*SQLClient) DeleteByID

func (t *SQLClient) DeleteByID(id int64) (err error)

DeleteByID 通过ID删除数据

func (*SQLClient) GetByID

func (t *SQLClient) GetByID(id int64, data any) (err error)

GetByID 获取指定的ID

func (*SQLClient) Init

func (t *SQLClient) Init() (err error)

Init 初始化数据库

func (*SQLClient) UpdateByID

func (t *SQLClient) UpdateByID(id int64, setFields []string, params map[string]any) (err error)

UpdateByID 通过ID更新数据

func (*SQLClient) UpdateDefaultFieldsByID

func (t *SQLClient) UpdateDefaultFieldsByID(id int64, params map[string]any) (err error)

UpdateDefaultFieldsByID 通过ID更新全量数据

Jump to

Keyboard shortcuts

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