ast

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggFunc added in v0.3.0

type AggFunc int
const (
	AggSum AggFunc = iota
	AggAvg
	AggMin
	AggMax
	AggCount
)

type AggregateExpr added in v0.3.0

type AggregateExpr struct {
	Func   AggFunc
	Column string
	Alias  string
}

type ComparisonNode

type ComparisonNode struct {
	Column string
	Op     Operator
	Value  any
	Values []any
}

type Direction

type Direction int
const (
	Asc Direction = iota
	Desc
)

type LogicalOp

type LogicalOp int
const (
	LogicalAnd LogicalOp = iota
	LogicalOr
	LogicalNot
)

type Operator

type Operator int
const (
	OpEq Operator = iota
	OpNEQ
	OpGT
	OpGTE
	OpLT
	OpLTE
	OpLike
	OpILike
	OpIn
	OpNotIn
	OpBetween
	OpIsNull
	OpIsNotNull
)

type OrderByExpr

type OrderByExpr struct {
	Column    string
	Direction Direction
}

type QueryType

type QueryType int
const (
	QuerySelect QueryType = iota
	QueryCount
	QueryExists
)

type SelectNode

type SelectNode struct {
	Table      string
	Columns    []string
	Where      *WhereClause
	OrderBy    []OrderByExpr
	Limit      *int
	Offset     *int
	Type       QueryType
	GroupBy    []string
	Having     *WhereClause
	Aggregates []AggregateExpr
}

type WhereClause

type WhereClause struct {
	Comparison *ComparisonNode
	LogicalOp  LogicalOp
	Children   []WhereClause
	Raw        *string
	RawArgs    []any
}

Jump to

Keyboard shortcuts

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