sqlbuilder

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Query 查询mysql数据库

func NewBuilder

func NewBuilder(querySQL string, args ...interface{}) *Builder

NewBuilder new 实例

func NewQuery

func NewQuery(querySQL string, args ...interface{}) *Builder

NewQuery new 实例

func (*Builder) Build

func (b *Builder) Build() (stmt string, args []interface{})

Build 组件SQL

func (*Builder) BuildCount

func (b *Builder) BuildCount() (stmt string, args []interface{})

func (*Builder) BuildFromNewBase

func (b *Builder) BuildFromNewBase(base string) (stmt string, args []interface{})

提供 base 替换 只提供条件语句 where, group, having

func (*Builder) BuildQuery

func (b *Builder) BuildQuery() (stmt string, args []interface{})

DEPRECEATED Build 组件SQL

func (*Builder) GroupBy

func (b *Builder) GroupBy(d string) *Builder

GroupBy todo

func (*Builder) Having

func (b *Builder) Having(stmt string, v ...interface{}) *Builder

Having 添加参数

func (*Builder) HavingArgs

func (b *Builder) HavingArgs() []interface{}

HavingArgs where 语句的参数

func (*Builder) HavingStmt

func (b *Builder) HavingStmt() []string

HavingStmt where条件列表

func (*Builder) LeftJoin

func (b *Builder) LeftJoin(j string) *JoinStmt

LeftJoin("xxxx").ON("xxx")

func (*Builder) Limit

func (b *Builder) Limit(offset int64, limit uint) *Builder

Limit Limit

func (*Builder) Order

func (b *Builder) Order(d string) *OrderStmt

Order todo

func (*Builder) RightJoin

func (b *Builder) RightJoin(j string) *JoinStmt

RIGHT("xxxx").ON("xxx")

func (*Builder) Set

func (b *Builder) Set(stmt string, v ...interface{}) *Builder

Where 添加参数

func (*Builder) Where

func (b *Builder) Where(stmt string, v ...interface{}) *Builder

Where 添加参数

func (*Builder) WhereArgs

func (b *Builder) WhereArgs() []interface{}

WhereArgs where 语句的参数

func (*Builder) WhereStmt

func (b *Builder) WhereStmt() []string

WhereStmt where条件列表

func (*Builder) WithHaving

func (b *Builder) WithHaving(stmts []string, args []interface{}) *Builder

WithHaving 携带条件

func (*Builder) WithWhere

func (b *Builder) WithWhere(stmts []string, args []interface{}) *Builder

WithWhere 携带条件

type JoinStmt

type JoinStmt struct {
	// contains filtered or unexported fields
}

func (*JoinStmt) ON

func (j *JoinStmt) ON(cond string) *Builder

type OrderStmt

type OrderStmt struct {
	// contains filtered or unexported fields
}

func (*OrderStmt) Asc

func (j *OrderStmt) Asc() *Builder

func (*OrderStmt) Desc

func (j *OrderStmt) Desc() *Builder

Jump to

Keyboard shortcuts

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