sqlboiler

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// CreateExcludes 创建操作默认忽略的字段
	CreateExcludes = []string{"id", "version", "created", "updated", "createdat", "updatedat", "r", "l"}
	// EditExcludes 编辑操作默认忽略的字段
	EditExcludes = []string{"id", "created", "updated", "createdat", "updatedat", "r", "l"}
)

预定义常用类型反射对象避免重复创建

Functions

func GetDB

func GetDB(args ...boil.Executor) boil.Executor

func GetLimitQueryMods

func GetLimitQueryMods(list *protobuf.ListParam) []qm.QueryMod

GetLimitQueryMods 获取Limit相关QueryMods

func JsonValue

func JsonValue(jsonColumn string, jsonKey string, defaultValue any) qm.QueryMod

func JsonValueCompare

func JsonValueCompare(jsonColumn string, jsonKey string, operator string, compareValue any) qm.QueryMod

func NewQmBuilder

func NewQmBuilder(mods ...qm.QueryMod) *qmBuilder

func WithUpdateTime

func WithUpdateTime(cols map[string]any, args ...string) map[string]any

WithUpdateTime 除了cols中的会更新以外还会更新更新时间字段

Types

type DbImpl added in v0.0.8

type DbImpl interface {
	Exclude(fieldNames ...string) DbImpl    // 设置排除字段
	AutoIncr(fieldNames ...string) DbImpl   // 设置自增字段
	JSONArray(fieldNames ...string) DbImpl  // 设置为Json数组的字段
	JSONObject(fieldNames ...string) DbImpl // 设置Json字段的处理函数为Json数组
	Copy(destObject any, source any) error  // 将source值填入到modelObject中
	Executor() boil.Executor
	Tid() int64
}

func Gdb added in v0.0.8

func Gdb(tx ...Transactor) DbImpl

func Tdb added in v0.0.8

func Tdb(tid int64, tx ...Transactor) DbImpl

type JoinClauseBuilder added in v0.0.4

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

func (*JoinClauseBuilder) And added in v0.0.4

func (j *JoinClauseBuilder) And(clause string) *JoinClauseBuilder

func (*JoinClauseBuilder) On added in v0.0.4

func (j *JoinClauseBuilder) On(columnOrTableColumn, thatTableColumn string) *JoinClauseBuilder

func (*JoinClauseBuilder) Output added in v0.0.4

func (j *JoinClauseBuilder) Output(args ...any) qm.QueryMod

type OrderByHelper added in v0.0.4

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

func (*OrderByHelper) Asc added in v0.0.4

func (o *OrderByHelper) Asc(col string) *OrderByHelper

func (*OrderByHelper) Desc added in v0.0.4

func (o *OrderByHelper) Desc(col string) *OrderByHelper

func (OrderByHelper) Output added in v0.0.4

func (o OrderByHelper) Output(args ...any) qm.QueryMod

type SQLHelper added in v0.0.4

type SQLHelper interface {
	IfNull(column string, defaultValue any, args ...string) string
	IfNullWithColumn(column string, anotherColumn string, args ...string) string
	JsonValue(jsonColumn string, jsonKey string, defaultValue any) qm.QueryMod
	JsonValueCompare(jsonColumn string, jsonKey string, operator string, compareValue any) qm.QueryMod
	SUM(col string, args ...string) string
	AsAliasColumn(alias, colName string) string
	InnerJoin(joinTable string, args ...string) *JoinClauseBuilder
	LeftJoin(joinTable string, args ...string) *JoinClauseBuilder
	OrderBy() *OrderByHelper
	Quote(s string) string
	SelectAll(tableName string) qm.QueryMod
}

func Mysql added in v0.0.3

func Mysql() SQLHelper

func Psql added in v0.0.3

func Psql() SQLHelper

type Transactor

type Transactor interface {
	Executor() boil.Executor
	Finalize(err error)
}

func NewTransactor

func NewTransactor(logger intf.LoggerProvider) (Transactor, error)

Jump to

Keyboard shortcuts

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