helper

package
v0.0.0-...-ba9a905 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckObject

func CheckObject(obj Object) error

CheckObject check ojbect

func IfClause

func IfClause(conds []Cond) string

IfClause if clause

func JoinSetBuilder

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

JoinSetBuilder join set builder

func JoinTrimAllBuilder

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

JoinTrimAllBuilder join trim builder, will trim and,or,xor, `,`

func JoinWhereBuilder

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

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

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

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

func NewJoinTblExpr

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

NewJoinTblExpr create new join table expr

func (JoinTblExpr) Build

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

Build ...

type Object

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