sql

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentExpression

type AssignmentExpression struct {
	Expression
}

func EmptyAssignmentExp

func EmptyAssignmentExp() AssignmentExpression

func (AssignmentExpression) Append

func (e AssignmentExpression) Append(column any, args ...any)

func (AssignmentExpression) Copy

type ColumnListExpression

type ColumnListExpression struct {
	ListExpression
}

func EmptyColumnListExp

func EmptyColumnListExp() ColumnListExpression

func NewColumnListExp

func NewColumnListExp(column any, args ...any) ColumnListExpression

func (ColumnListExpression) Append

func (e ColumnListExpression) Append(column any, args ...any)

Append adds column with its alias to the expression:

  • Append(column any)
  • Append(column any, alias any)

func (ColumnListExpression) Copy

type ConditionalExpression

type ConditionalExpression struct {
	Expression
}

func EmptyCondExp

func EmptyCondExp() ConditionalExpression

func NewCondExp

func NewCondExp(args ...any) ConditionalExpression

func (ConditionalExpression) AndWhere

func (e ConditionalExpression) AndWhere(args ...any) ConditionalExpression

AndWhere add "AND" condition to the expression:

  • AndWhere(condition string)
  • AndWhere(condition ConditionalExpression)
  • AndWhere(column string, operator string, value any)
  • AndWhere(operand any, operator string, value any)
  • AndWhere(operator string, operand any)

func (ConditionalExpression) Copy

func (ConditionalExpression) OrWhere

func (e ConditionalExpression) OrWhere(args ...any) ConditionalExpression

OrWhere add "OR" condition to the expression:

  • OrWhere(condition string)
  • OrWhere(condition ConditionalExpression)
  • OrWhere(column string, operator string, value any)
  • OrWhere(operand any, operator string, value any)
  • OrWhere(operator string, operand any)

func (ConditionalExpression) Where

Where add "OR" or "AND" condition to the expression:

  • Where(condition string)
  • Where(condition ConditionalExpression)
  • Where(column string, operator string, value any)
  • Where(operand any, operator string, value any)
  • Where(operator string, operand any)

type Connector

type Connector string
const (
	AND Connector = "AND"
	OR  Connector = "OR"
)

func (Connector) String

func (c Connector) String() string

type DirectListExpression

type DirectListExpression struct {
	ListExpression
}

func EmptyDirectListExp

func EmptyDirectListExp() DirectListExpression

func (DirectListExpression) Append

func (e DirectListExpression) Append(name any, args ...any)

func (DirectListExpression) Copy

type Expression

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

func EmptyExp

func EmptyExp() Expression

func NewExp

func NewExp(sql string) Expression

func NewExpWithParams

func NewExpWithParams(sql string, params map[string]any) Expression

func (Expression) AddParams

func (e Expression) AddParams(params map[string]any)

func (Expression) AddSql

func (e Expression) AddSql(sql string)

func (Expression) Clean

func (e Expression) Clean()

func (Expression) Copy

func (e Expression) Copy() Expression

func (Expression) IsEmpty

func (e Expression) IsEmpty() bool

func (Expression) IsNotEmpty

func (e Expression) IsNotEmpty() bool

func (Expression) Params

func (e Expression) Params() map[string]any

func (Expression) String

func (e Expression) String() string

type JoinExpression

type JoinExpression struct {
	Expression
}

func EmptyJoinExp

func EmptyJoinExp() JoinExpression

func (JoinExpression) Append

func (e JoinExpression) Append(joinType string, table any, args ...any)

func (JoinExpression) Copy

func (e JoinExpression) Copy() JoinExpression

type ListExpression

type ListExpression struct {
	Expression
	// contains filtered or unexported fields
}

func EmptyListExp

func EmptyListExp(reverseOrder bool) ListExpression

func (ListExpression) AppendName

func (e ListExpression) AppendName(name any, alias any)

func (ListExpression) Copy

func (e ListExpression) Copy() ListExpression

type ReversedListExpression

type ReversedListExpression struct {
	ListExpression
}

func EmptyReversedListExp

func EmptyReversedListExp() ReversedListExpression

func (ReversedListExpression) Append

func (e ReversedListExpression) Append(alias any, args ...any)

func (ReversedListExpression) Copy

type ValueListExpression

type ValueListExpression struct {
	Expression
}

func EmptyValueListExp

func EmptyValueListExp() ValueListExpression

func NewValueListExp

func NewValueListExp(values any) ValueListExpression

func (ValueListExpression) Append

func (e ValueListExpression) Append(values any)

func (ValueListExpression) Copy

type WithExpression

type WithExpression struct {
	Expression
}

func EmptyWithExp

func EmptyWithExp() WithExpression

func (WithExpression) Append

func (e WithExpression) Append(recursive bool, query any, args ...any)

func (WithExpression) Copy

func (e WithExpression) Copy() WithExpression

Jump to

Keyboard shortcuts

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