clause_checker

package
v1.2.48 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Where      = "WHERE"
	Returning  = "RETURNING"
	OnConflict = "ON CONFLICT"
	From       = "FROM"
	Set        = "SET"
	Select     = "SELECT"
	Limit      = "LIMIT"
	OrderBy    = "ORDER BY"
	GroupBy    = "GROUP BY"
)

gorm support clause

Variables

This section is empty.

Functions

func FalseExpr

func FalseExpr() clause.NamedExpr

func GroupByClause

func GroupByClause(tx *gorm.DB) (groupByClause clause.GroupBy, ok bool)

func LimitClause

func LimitClause(tx *gorm.DB) (limitClause clause.Limit, ok bool)

func NoWhereClause

func NoWhereClause(tx *gorm.DB) bool

func OrderByClause

func OrderByClause(tx *gorm.DB) (orderByClause clause.OrderBy, ok bool)

func TrueExpr

func TrueExpr() clause.NamedExpr

func WhereClause

func WhereClause(tx *gorm.DB) (whereClause clause.Where, ok bool)

Types

type Config

type Config struct {
	PluginName string

	// effect on where clause
	LikeNoPrefixMatch    bool // ignore or warn of (column LIKE '%which')
	IndexColumnNoExpr    bool // ignore or warn of indexed_column use expr or function
	InExprMaxValuesLen   *int
	BinaryExprStrongType bool
	NoRegexp             bool

	// effect on where clause on raw and row
	AllowWrapRawOrRowByClause bool

	// effect on orderBy clause
	OrderByNoIndexColumn bool
}

func (*Config) Clause

func (cfg *Config) Clause(tx *gorm.DB)

func (*Config) GroupByClause

func (cfg *Config) GroupByClause(tx *gorm.DB)

GroupByClause GROUP BY and HAVING

func (*Config) Initialize

func (cfg *Config) Initialize(tx *gorm.DB) error

func (*Config) LimitClause

func (cfg *Config) LimitClause(tx *gorm.DB)

LimitClause LIMIT and OFFSET

func (*Config) Name

func (cfg *Config) Name() string

func (*Config) OrderByClause

func (cfg *Config) OrderByClause(tx *gorm.DB)

OrderByClause ORDER BY column or ORDER BY columnList

func (*Config) WhereClause

func (cfg *Config) WhereClause(tx *gorm.DB)

WhereClause Expr or ExprList

Jump to

Keyboard shortcuts

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