helper

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 4 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckObject added in v0.3.0

func CheckObject(obj Object) error

CheckObject check ojbect

func IfClause

func IfClause(conds []Cond) string

IfClause if clause

func JoinSetBuilder added in v0.1.27

func JoinSetBuilder(src *strings.Builder, setValue strings.Builder)

JoinSetBuilder join set builder

func JoinWhereBuilder added in v0.1.27

func JoinWhereBuilder(src *strings.Builder, whereValue strings.Builder)

JoinWhereBuilder join where builder

func SetClause

func SetClause(conds []string) string

SetClause set clause

func WhereClause

func WhereClause(conds []string) string

WhereClause where clause

Types

type Cond

type Cond struct {
	Cond   bool
	Result string
}

Cond ...

type Field added in v0.3.0

type Field interface {
	// Name return field name
	Name() string
	// Type return field type
	Type() string

	// ColumnName return column name
	ColumnName() string
	// GORMTag return gorm tag
	GORMTag() string
	// JSONTag return json tag
	JSONTag() string
	// Tag return field tag
	Tag() string

	// Comment return comment
	Comment() string
}

Field a field interface

type JoinTblExpr added in v0.2.44

type JoinTblExpr struct {
	clause.Join
	TableExpr clause.Expression
}

JoinTblExpr join clause with table expression(sub query...)

func NewJoinTblExpr added in v0.2.44

func NewJoinTblExpr(join clause.Join, tbExpr clause.Expression) JoinTblExpr

NewJoinTblExpr create new join table expr

func (JoinTblExpr) Build added in v0.2.44

func (join JoinTblExpr) Build(builder clause.Builder)

Build ...

type Object added in v0.3.0

type Object interface {
	// TableName return table name
	TableName() string
	// StructName return struct name
	StructName() string
	// FileName return field name
	FileName() string
	// ImportPkgPaths return need import package path
	ImportPkgPaths() []string

	// Fields return field array
	Fields() []Field
}

Object an object interface

Jump to

Keyboard shortcuts

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