gf_orm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, accessVerify bool, role string, access *db.Access) (executor.QueryExecutor, error)

Types

type ActionExecutor

type ActionExecutor struct {
	DbName string
}

func (*ActionExecutor) Delete

func (a *ActionExecutor) Delete(ctx context.Context, table string, where g.Map) (count int64, err error)

func (*ActionExecutor) Insert

func (a *ActionExecutor) Insert(ctx context.Context, table string, data any) (id int64, count int64, err error)

func (*ActionExecutor) Update

func (a *ActionExecutor) Update(ctx context.Context, table string, data g.Map, where g.Map) (count int64, err error)

type SqlExecutor

type SqlExecutor struct {
	Role string

	//保存where条件 [ ["user_id",">", 123], ["user_id","<=",345] ]
	Where [][]any

	Columns []string
	Order   string
	Group   string

	// 是否最终为空结果, 用于node中中断数据获取
	WithEmptyResult bool
	// contains filtered or unexported fields
}

func (*SqlExecutor) EmptyResult

func (e *SqlExecutor) EmptyResult()

func (*SqlExecutor) List

func (e *SqlExecutor) List(page int, count int, needTotal bool) (list []g.Map, total int64, err error)

func (*SqlExecutor) One

func (e *SqlExecutor) One() (g.Map, error)

func (*SqlExecutor) ParseCondition

func (e *SqlExecutor) ParseCondition(conditions g.MapStrAny, accessVerify bool) error

ParseCondition 解析查询条件 accessVerify 内部调用时, 不校验是否可使用该种查询方式

func (*SqlExecutor) ParseCtrl

func (e *SqlExecutor) ParseCtrl(ctrl g.Map) error

ParseCtrl 解析 @column,@group等控制类

Jump to

Keyboard shortcuts

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