clause

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type And

type And []Expression

And represents an AND expression

func (And) Build

func (a And) Build() (string, []any, error)

type Assignment

type Assignment struct {
	Column Column
	Value  any
}

Assignment represents a column assignment for UPDATE

func (Assignment) Build

func (a Assignment) Build() (string, []any, error)

type Between

type Between struct {
	Column Column
	Min    any
	Max    any
}

Between represents a BETWEEN expression

func (Between) Build

func (b Between) Build() (string, []any, error)

type Column

type Column struct {
	Table string
	Name  string
}

Column represents a database column with optional table qualifier

func (Column) Column added in v0.2.0

func (c Column) Column() Column

func (Column) ColumnName

func (c Column) ColumnName() string

ColumnName returns the full column name (with table prefix if specified)

type Columnar

type Columnar interface {
	ColumnName() string
}

Columnar defines an interface for providing a column name.

type Eq

type Eq struct {
	Column Column
	Value  any
}

Eq represents an equality expression (column = value)

func (Eq) Build

func (e Eq) Build() (string, []any, error)

type ExistsExpr added in v0.2.0

type ExistsExpr struct {
	Expr Expression
}

ExistsExpr represents EXISTS (expression)

func (ExistsExpr) Build added in v0.2.0

func (e ExistsExpr) Build() (string, []any, error)

type Expr

type Expr struct {
	SQL  string
	Vars []any
}

Expr represents a custom SQL expression

func (Expr) Build

func (e Expr) Build() (string, []any, error)

type Expression

type Expression interface {
	Build() (sql string, args []any, err error)
}

Expression is the base interface for all SQL expressions

type Gt

type Gt struct {
	Column Column
	Value  any
}

Gt represents a greater than expression (column > value)

func (Gt) Build

func (g Gt) Build() (string, []any, error)

type Gte

type Gte struct {
	Column Column
	Value  any
}

Gte represents a greater than or equal expression (column >= value)

func (Gte) Build

func (g Gte) Build() (string, []any, error)

type IN

type IN struct {
	Column Column
	Values []any
}

IN represents an IN expression

func (IN) Build

func (i IN) Build() (string, []any, error)

type InExpr added in v0.2.0

type InExpr struct {
	Column Column
	Expr   Expression
}

InExpr represents column IN (expression) - typically used for subqueries

func (InExpr) Build added in v0.2.0

func (i InExpr) Build() (string, []any, error)

type IsNotNull

type IsNotNull struct {
	Column Column
}

IsNotNull represents an IS NOT NULL expression

func (IsNotNull) Build

func (i IsNotNull) Build() (string, []any, error)

type IsNull

type IsNull struct {
	Column Column
}

IsNull represents an IS NULL expression

func (IsNull) Build

func (i IsNull) Build() (string, []any, error)

type Like

type Like struct {
	Column Column
	Value  string
}

Like represents a LIKE expression

func (Like) Build

func (l Like) Build() (string, []any, error)

type Lt

type Lt struct {
	Column Column
	Value  any
}

Lt represents a less than expression (column < value)

func (Lt) Build

func (l Lt) Build() (string, []any, error)

type Lte

type Lte struct {
	Column Column
	Value  any
}

Lte represents a less than or equal expression (column <= value)

func (Lte) Build

func (l Lte) Build() (string, []any, error)

type Neq

type Neq struct {
	Column Column
	Value  any
}

Neq represents a not equal expression (column != value)

func (Neq) Build

func (n Neq) Build() (string, []any, error)

type Not

type Not struct {
	Expr Expression
}

Not represents a NOT expression

func (Not) Build

func (n Not) Build() (string, []any, error)

type NotExistsExpr added in v0.2.0

type NotExistsExpr struct {
	Expr Expression
}

NotExistsExpr represents NOT EXISTS (expression)

func (NotExistsExpr) Build added in v0.2.0

func (n NotExistsExpr) Build() (string, []any, error)

type NotInExpr added in v0.2.0

type NotInExpr struct {
	Column Column
	Expr   Expression
}

NotInExpr represents column NOT IN (expression) - typically used for subqueries

func (NotInExpr) Build added in v0.2.0

func (n NotInExpr) Build() (string, []any, error)

type NotLike

type NotLike struct {
	Column Column
	Value  string
}

NotLike represents a NOT LIKE expression

func (NotLike) Build

func (n NotLike) Build() (string, []any, error)

type Or

type Or []Expression

Or represents an OR expression

func (Or) Build

func (o Or) Build() (string, []any, error)

type OrderByColumn

type OrderByColumn struct {
	Column Column
	Desc   bool
}

OrderByColumn represents an ORDER BY column

func (OrderByColumn) Build

func (o OrderByColumn) Build() (string, []any, error)

Jump to

Keyboard shortcuts

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