sql

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

func Args(sql, prefix string) string

func Clause

func Clause(op LogicalOperator, mods ...string) string

func Column

func Column(c ...string) string

func Expr

func Expr(s string) string

func Group

func Group(s ...string) string

func Query

func Query(c ...string) string

func Where

func Where(s string, op Operator, v ...string) string

func WhereComposite

func WhereComposite[T any](op Operator, cols []T, f func(c T) string) string

func WhereEndsWith

func WhereEndsWith(s string, v any) (string, any)

func WhereIn

func WhereIn(s string, v any) (string, any)

func WhereLike

func WhereLike(s string, v any) (string, any)

func WhereNotIn

func WhereNotIn(s string, v any) (string, any)

func WhereNotLike

func WhereNotLike(s string, v any) (string, any)

func WhereStartsWith

func WhereStartsWith(s string, v any) (string, any)

Types

type LogicalOperator

type LogicalOperator string
const (
	AND      LogicalOperator = "AND"
	OR       LogicalOperator = "OR"
	ORDER_BY LogicalOperator = "ORDER BY"
)

func (LogicalOperator) String

func (lo LogicalOperator) String(space bool) string

type Operator

type Operator string
const (
	Equal              Operator = "="
	NotEqual           Operator = "!="
	GreaterThan        Operator = ">"
	GreaterThanOrEqual Operator = ">="
	LessThan           Operator = "<"
	LessThanOrEqual    Operator = "<="
	In                 Operator = "IN"
	NotIn              Operator = "NOT IN"
	Like               Operator = "LIKE"
	ILIkE              Operator = "ILIKE"
	NotLike            Operator = "NOT LIKE"
	IsNull             Operator = "IS NULL"
	IsNotNull          Operator = "IS NOT NULL"
)

func (Operator) String

func (o Operator) String() string

type Order

type Order string
var (
	ASC  Order = "ASC"
	DESC Order = "DESC"
)

func (Order) IsValid

func (o Order) IsValid() bool

func (Order) String

func (o Order) String() string

Jump to

Keyboard shortcuts

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