expr

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Space      = Raw(internal.Space)
	CommaSpace = Raw(internal.CommaSpace)
	NewLine    = Raw(internal.NewLine)
	OpenPar    = Raw(internal.OpenPar)
	ClosePar   = Raw(internal.ClosePar)

	CommaWriterNewLine   = J(Raw(internal.Comma), WriterNewLine)
	CommaWriterSeparator = J(Raw(internal.Comma), WriterSeparator)
)
View Source
var ErrNoNamedArgs = errors.New("Dialect does not support named arguments")
View Source
var WriterNewLine = litsql.ExpressionFunc(func(w litsql.Writer, d litsql.Dialect, start int) ([]any, error) {
	w.WriteNewLine()
	return nil, nil
})
View Source
var WriterSeparator = litsql.ExpressionFunc(func(w litsql.Writer, d litsql.Dialect, start int) ([]any, error) {
	w.WriteSeparator()
	return nil, nil
})

Functions

func And

func And(expr ...string) litsql.Expression

func AndE

func AndE(expr ...litsql.Expression) litsql.Expression

func Arg

func Arg(value any) litsql.Expression

func Args

func Args(values []any) []litsql.Expression

func C

func C(query string, args ...any) litsql.Expression

func CastSlice

func CastSlice[E litsql.Expression](list []E) []litsql.Expression

func ExprIf added in v0.3.2

func ExprIf(condition bool, e litsql.Expression) litsql.Expression

func ExprIfElse added in v0.3.6

func ExprIfElse(condition bool, etrue, efalse litsql.Expression) litsql.Expression

func F added in v0.3.6

func F(f func() (litsql.Expression, error)) litsql.Expression

F calls the function to return the expression to output.

func In

func In(values ...any) litsql.Expression

func InP

func InP(values ...any) litsql.Expression

func J

func J(exprs ...litsql.Expression) litsql.Expression

func JS

func JS(sep string, exprs ...litsql.Expression) litsql.Expression

func Or

func Or(expr ...string) litsql.Expression

func OrE

func OrE(expr ...litsql.Expression) litsql.Expression

func Paren

func Paren(expr ...string) litsql.Expression

func ParenE

func ParenE(expr ...litsql.Expression) litsql.Expression

func PrefixIf added in v0.3.2

func PrefixIf(condition bool, prefix litsql.Expression, e litsql.Expression) litsql.Expression

func Quote

func Quote(aa ...string) litsql.Expression

func QuoteCheck

func QuoteCheck(aa ...string) litsql.Expression

func S

func S(str string) litsql.Expression

func SL

func SL(str []string) []litsql.Expression

func SLQ

func SLQ(str []string) []litsql.Expression

func SLQC

func SLQC(str []string) []litsql.Expression

func SQ

func SQ(str string) litsql.Expression

func SQC

func SQC(str string) litsql.Expression

func WriterAddSeparator

func WriterAddSeparator(topLevel bool) litsql.Expression

Types

type Raw

type Raw string

func (Raw) WriteSQL

func (r Raw) WriteSQL(w litsql.Writer, d litsql.Dialect, start int) ([]any, error)

Jump to

Keyboard shortcuts

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