kstmt

package
v1.2.46 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoEmpty = &Empty{}

Functions

This section is empty.

Types

type AsAliasExpr

type AsAliasExpr struct {
	As    *Empty
	Alias string
}

type AtLeastOne

type AtLeastOne[T any] struct {
	First  T
	Remain []T
}

type BetweenAndExpr

type BetweenAndExpr struct {
	Expr  Expr
	Not   *Empty
	LExpr Expr
	RExpr Expr
}

type BinaryExpr

type BinaryExpr struct {
	LExpr    Expr
	Operator BinaryOperator
	RExpr    Expr
}

type BinaryOperator

type BinaryOperator string

type BindParameter

type BindParameter struct {
}

type BlobLiteral

type BlobLiteral struct {
}

type CaseWhenExpr

type CaseWhenExpr struct {
	Expr     *Expr
	WhenThen AtLeastOne[WhenThenExpr]
	Else     *ElseExpr
}

type CastAsExpr

type CastAsExpr struct {
	Expr     Expr
	TypeName TypeName
}

type Column

type Column struct {
	Name  string
	Table *Table
}

type ColumnAliasExpr

type ColumnAliasExpr struct {
	Expr        Expr
	As          *Empty
	ColumnAlias *string
}

type ColumnExpr

type ColumnExpr struct {
	Column *string
	Expr   *Expr
}

type ColumnList

type ColumnList AtLeastOne[string]

type CommonTableExpr

type CommonTableExpr struct {
	Table  string
	Column []string

	Materialized *struct {
		Not *Empty
	}

	SelectStmt SelectStmt
}

func (CommonTableExpr) Build

func (b CommonTableExpr) Build(w io.Writer)

type CompoundOperator

type CompoundOperator struct {
	Union     *Empty
	UnionAll  *Empty
	Intersect *Empty
	Except    *Empty
}

type CompoundSelect

type CompoundSelect struct {
	Operator CompoundOperator
	Select   SelectCore
}

type CompoundSelectStmt

type CompoundSelectStmt struct {
	SimpleSelectStmt
	Compound AtLeastOne[CompoundSelect]
}

type ConflictTarget

type ConflictTarget struct {
	Column *AtLeastOne[IndexedColumn]
	Where  *Expr
}

type DataFromStmt

type DataFromStmt struct {
	Values    *Values
	Select    *SelectStmt
	Upsert    *UpsertClause
	Default   *Empty
	Returning *ReturningClause
}

type DeleteStmt

type DeleteStmt struct {
	With      *WithCommonTableExpr
	Table     QualifiedTable
	Where     *Expr
	Returning *ReturningClause
	Limit     *DeleteStmtLimited
}

type DeleteStmtLimited

type DeleteStmtLimited struct {
	Delete  DeleteStmt
	OrderBy *OrderByClause
	Limit   *LimitClause
}

type DistinctFromExpr

type DistinctFromExpr struct {
	Start        Expr
	Not          *Empty
	DistinctFrom *Empty
	End          Expr
}

type ElseExpr

type ElseExpr struct {
	Expr Expr
}

type Empty

type Empty struct{}

type EscapeExpr

type EscapeExpr struct {
	Expr Expr
}

type ExistsExpr

type ExistsExpr struct {
	Exists     *NotExistsExpr
	SelectStmt SelectStmt
}

type Expr

type Expr interface {
	kinternal.WriteBuilder
}

type ExprList

type ExprList AtLeastOne[Expr]

type FactoredSelectStmt

type FactoredSelectStmt struct {
	SimpleSelectStmt
	Compound []CompoundSelect
}

type FilterClause

type FilterClause struct {
	Where Expr
}

type FrameSpec

type FrameSpec struct {
	RRG     FrameSpecRRG
	BUEC    FrameSpecBUEC
	Exclude *FrameSpecExclude
}

type FrameSpecBUEC

type FrameSpecBUEC struct {
	BetweenAnd         *FrameSpecBetweenAnd
	UnboundedPreceding *Empty
	ExprPreceding      *Expr
	CurrentRow         *Empty
}

type FrameSpecBetweenAnd

type FrameSpecBetweenAnd struct {
	LExpr struct {
		UnboundedPreceding *Empty
		ExprPreceding      *Expr
		CurrentRow         *Empty
		ExprFollowing      *Expr
	}
	RExpr struct {
		ExprPreceding      *Expr
		CurrentRow         *Empty
		ExprFollowing      *Expr
		UnboundedFollowing *Empty
	}
}

type FrameSpecExclude

type FrameSpecExclude struct {
	NoOthers   *Empty
	CurrentRow *Empty
	Group      *Empty
	Ties       *Empty
}

type FrameSpecRRG

type FrameSpecRRG struct {
	Range  *Empty
	Rows   *Empty
	Groups *Empty
}

type FromExpr

type FromExpr struct {
	TableOrSubquery *AtLeastOne[TableOrSubquery]
	Join            *JoinClause
}

type FuncArgs

type FuncArgs struct {
	Distinct *Empty
	Expr     *ExprList
	OrderBy  *OrderByClause
	Star     *Empty
}

type FuncExpr

type FuncExpr struct {
	Name         string
	Args         FuncArgs
	FilterClause *FilterClause
	OverClause   *OverClause
}

type GRMExpr

type GRMExpr struct {
	Glob   *Empty
	Regexp *Empty
	Match  *Empty
	Expr   Expr
}

type InExpr

type InExpr struct {
	Expr       Expr
	Not        *Empty
	SelectStmt *SelectStmtExpr
	Schema     *string
	TableExpr  TableExpr
}

type IndexExpr

type IndexExpr struct {
	IndexedBy  *string
	NotIndexed *Empty
}

type IndexedColumn

type IndexedColumn struct {
	Column  ColumnExpr
	Collate *string
	Order   *Order
}

type InsertExpr

type InsertExpr struct {
	Opt *WriteFailOpt
}

type InsertStmt

type InsertStmt struct {
	With   *WithCommonTableExpr
	Write  ReplaceOrInsertExpr
	Table  Table
	As     *AsAliasExpr
	Column ColumnList
	Data   DataFromStmt
}

type Join

type Join struct {
	Operator   JoinOperator
	Dest       TableOrSubquery
	Constraint JoinConstraint
}

type JoinClause

type JoinClause struct {
	TableOrSubquery TableOrSubquery
	Joins           []Join
}

type JoinConstraint

type JoinConstraint struct {
	On    *Expr
	Using *ColumnList
}

type JoinOp

type JoinOp struct {
	Cross *Empty
	Op    *JoinOp0
}

type JoinOp0

type JoinOp0 struct {
	Natural *Empty
	Op      *JoinOp1
}

type JoinOp1

type JoinOp1 struct {
	Inner *Empty
	Op    *JoinOp2
}

type JoinOp2

type JoinOp2 struct {
	Scope *LRFOp
	Outer *Empty
}

type JoinOperator

type JoinOperator struct {
	Comma *Empty
	Join  *JoinOp
}

type LRFOp

type LRFOp struct {
	Left  *Empty
	Right *Empty
	Full  *Empty
}

type LikeExpr

type LikeExpr struct {
	Expr   Expr
	Escape *EscapeExpr
}

type LikeOrGRMExpr

type LikeOrGRMExpr struct {
	Expr Expr
	Not  *Empty
	Like *LikeExpr
	GRM  *GRMExpr
}

type LimitClause

type LimitClause struct {
	Expr   Expr
	Offset *Expr
	Comma  *Expr
}

type LiteralValue

type LiteralValue struct {
	Numeric          *NumericLiteral
	String           *StringLiteral
	Blob             *BlobLiteral
	Null             *Empty
	True             *Empty
	False            *Empty
	CurrentTime      *Empty
	CurrentDate      *Empty
	CurrentTimestamp *Empty
}

type NotExistsExpr

type NotExistsExpr struct {
	Not *Empty
}

type NullExpr

type NullExpr struct {
	Expr         Expr
	IsNull       *Empty
	NotNull      *Empty // NOTNULL
	NotSpaceNull *Empty // NOT NULL
}

type NumericLiteral

type NumericLiteral struct {
}

type Order

type Order struct {
	Asc  *Empty
	Desc *Empty
}

type OrderByClause

type OrderByClause AtLeastOne[OrderingTerm]

type OrderingTerm

type OrderingTerm struct {
	Expr       Expr
	Collate    *string
	Order      *Order
	NullsFirst *Empty
	NullsLast  *Empty
}

type OverClause

type OverClause struct {
	WindowName *string
	Window     *WindowDefn
}

type Pair

type Pair[T any] struct {
	First, Second T
}

type QualifiedTable

type QualifiedTable struct {
	Table Table
	As    *AsAliasExpr
	Index *IndexExpr
}

type RaiseFunc

type RaiseFunc struct {
	Ignore       *Empty
	Rollback     *Empty
	Abort        *Empty
	Fail         *Empty
	ErrorMessage *string
}

type RaiseFuncExpr

type RaiseFuncExpr struct {
}

type ReplaceOrInsertExpr

type ReplaceOrInsertExpr struct {
	Replace *Empty
	Insert  *InsertExpr
}

type ResultColumn

type ResultColumn struct {
	Expr         *ReturningExpr
	TableDotStar *string
}

type ResultColumnList

type ResultColumnList AtLeastOne[ResultColumn]

type ReturningClause

type ReturningClause struct {
	Expr AtLeastOne[ReturningExpr]
}

type ReturningExpr

type ReturningExpr struct {
	Star *Empty
	Expr *ColumnAliasExpr
}

type SelectCore

type SelectCore struct {
	Expr   *SelectExpr
	Values *Values
}

type SelectExpr

type SelectExpr struct {
	Distinct *Empty
	All      *Empty
	Column   ResultColumnList
	From     FromExpr
	Where    *Expr
	GroupBy  *ExprList
	Having   *Expr
	Window   *AtLeastOne[WindowExpr]
}

type SelectStmt

type SelectStmt FactoredSelectStmt

func (SelectStmt) Build

func (b SelectStmt) Build(w io.Writer)

type SelectStmtExpr

type SelectStmtExpr struct {
	SelectStmt *SelectStmt
	Expr       ExprList
}

type SetExpr

type SetExpr struct {
	Column  *string
	Columns *ColumnList
	Expr    Expr
}

type SignedNumber

type SignedNumber struct {
	Positive *Empty
	Negative *Empty
	Number   NumericLiteral
}

type SimpleSelectStmt

type SimpleSelectStmt struct {
	With    *WithCommonTableExpr
	Select  SelectCore
	OrderBy *OrderByClause
	Limit   *LimitClause
}

type StringLiteral

type StringLiteral struct {
}

type Table

type Table struct {
	Name   string
	Schema *string
}

type TableExpr

type TableExpr struct {
	Table     *string
	TableFunc *TableFuncExpr
}

type TableFunc

type TableFunc string

type TableFuncExpr

type TableFuncExpr struct {
	Func TableFunc
	Expr ExprList
}

type TableOrSubquery

type TableOrSubquery struct {
	Schema    *string
	TableExpr *struct {
		Name  string
		Index IndexExpr
	}
	TableFunc *TableFuncExpr
	Select    *SelectStmt
	As        *AsAliasExpr
	Recursive *struct {
		R    *AtLeastOne[TableOrSubquery]
		Join *JoinClause
	}
}

type TypeName

type TypeName struct {
	Name AtLeastOne[string]
	One  *SignedNumber
	Pair *Pair[SignedNumber]
}

type UnaryExpr

type UnaryExpr struct {
	Operator UnaryOperator
	Expr     Expr
}

type UnaryOperator

type UnaryOperator string

type UpdateSetExpr

type UpdateSetExpr AtLeastOne[SetExpr]

type UpdateStmt

type UpdateStmt struct {
	With      *WithCommonTableExpr
	Opt       *WriteFailOpt
	Table     QualifiedTable
	Set       UpdateSetExpr
	From      *FromExpr
	Where     *Expr
	Returning *ReturningClause
}

type UpdateStmtLimited

type UpdateStmtLimited struct {
	Update  UpdateStmt
	OrderBy *OrderByClause
	Limit   *LimitClause
}

type UpsertClause

type UpsertClause AtLeastOne[UpsertExpr]

type UpsertExpr

type UpsertExpr struct {
	Target  ConflictTarget
	Nothing *Empty
	Update  *struct {
		Set   *UpdateSetExpr
		Where *Expr
	}
}

type Values

type Values AtLeastOne[ExprList]

type WhenThenExpr

type WhenThenExpr struct {
	When Expr
	Then Expr
}

type WindowDefn

type WindowDefn struct {
	BaseName    *string
	PartitionBy *ExprList
	OrderBy     *OrderByClause
	Frame       *FrameSpec
}

type WindowExpr

type WindowExpr struct {
	Name string
	As   WindowDefn
}

type WithCommonTableExpr

type WithCommonTableExpr struct {
	Recursive *Empty
	TableExpr AtLeastOne[CommonTableExpr]
}

type WriteFailOpt

type WriteFailOpt struct {
	Abort    *Empty
	Fail     *Empty
	Ignore   *Empty
	Replace  *Empty
	Rollback *Empty
}

Jump to

Keyboard shortcuts

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