Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 0 additions & 271 deletions ast/ast.go

This file was deleted.

8 changes: 8 additions & 0 deletions ast/batch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package ast

// Batch represents a T-SQL batch of statements.
type Batch struct {
Statements []Statement `json:"Statements,omitempty"`
}

func (*Batch) node() {}
11 changes: 11 additions & 0 deletions ast/boolean_binary_expression.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ast

// BooleanBinaryExpression represents a binary boolean expression (AND, OR).
type BooleanBinaryExpression struct {
BinaryExpressionType string `json:"BinaryExpressionType,omitempty"`
FirstExpression BooleanExpression `json:"FirstExpression,omitempty"`
SecondExpression BooleanExpression `json:"SecondExpression,omitempty"`
}

func (*BooleanBinaryExpression) node() {}
func (*BooleanBinaryExpression) booleanExpression() {}
11 changes: 11 additions & 0 deletions ast/boolean_comparison_expression.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ast

// BooleanComparisonExpression represents a comparison expression.
type BooleanComparisonExpression struct {
ComparisonType string `json:"ComparisonType,omitempty"`
FirstExpression ScalarExpression `json:"FirstExpression,omitempty"`
SecondExpression ScalarExpression `json:"SecondExpression,omitempty"`
}

func (*BooleanComparisonExpression) node() {}
func (*BooleanComparisonExpression) booleanExpression() {}
7 changes: 7 additions & 0 deletions ast/boolean_expression.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package ast

// BooleanExpression is the interface for boolean expressions.
type BooleanExpression interface {
Node
booleanExpression()
}
10 changes: 10 additions & 0 deletions ast/column_reference_expression.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ast

// ColumnReferenceExpression represents a column reference.
type ColumnReferenceExpression struct {
ColumnType string `json:"ColumnType,omitempty"`
MultiPartIdentifier *MultiPartIdentifier `json:"MultiPartIdentifier,omitempty"`
}

func (*ColumnReferenceExpression) node() {}
func (*ColumnReferenceExpression) scalarExpression() {}
10 changes: 10 additions & 0 deletions ast/expression_grouping_specification.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ast

// ExpressionGroupingSpecification represents a grouping by expression.
type ExpressionGroupingSpecification struct {
Expression ScalarExpression `json:"Expression,omitempty"`
DistributedAggregation bool `json:"DistributedAggregation,omitempty"`
}

func (*ExpressionGroupingSpecification) node() {}
func (*ExpressionGroupingSpecification) groupingSpecification() {}
9 changes: 9 additions & 0 deletions ast/expression_with_sort_order.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ast

// ExpressionWithSortOrder represents an expression with sort order.
type ExpressionWithSortOrder struct {
SortOrder string `json:"SortOrder,omitempty"`
Expression ScalarExpression `json:"Expression,omitempty"`
}

func (*ExpressionWithSortOrder) node() {}
8 changes: 8 additions & 0 deletions ast/from_clause.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package ast

// FromClause represents a FROM clause.
type FromClause struct {
TableReferences []TableReference `json:"TableReferences,omitempty"`
}

func (*FromClause) node() {}
12 changes: 12 additions & 0 deletions ast/function_call.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package ast

// FunctionCall represents a function call.
type FunctionCall struct {
FunctionName *Identifier `json:"FunctionName,omitempty"`
Parameters []ScalarExpression `json:"Parameters,omitempty"`
UniqueRowFilter string `json:"UniqueRowFilter,omitempty"`
WithArrayWrapper bool `json:"WithArrayWrapper,omitempty"`
}

func (*FunctionCall) node() {}
func (*FunctionCall) scalarExpression() {}
10 changes: 10 additions & 0 deletions ast/group_by_clause.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package ast

// GroupByClause represents a GROUP BY clause.
type GroupByClause struct {
GroupByOption string `json:"GroupByOption,omitempty"`
All bool `json:"All,omitempty"`
GroupingSpecifications []GroupingSpecification `json:"GroupingSpecifications,omitempty"`
}

func (*GroupByClause) node() {}
7 changes: 7 additions & 0 deletions ast/grouping_specification.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package ast

// GroupingSpecification is the interface for grouping specifications.
type GroupingSpecification interface {
Node
groupingSpecification()
}
8 changes: 8 additions & 0 deletions ast/having_clause.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package ast

// HavingClause represents a HAVING clause.
type HavingClause struct {
SearchCondition BooleanExpression `json:"SearchCondition,omitempty"`
}

func (*HavingClause) node() {}
Loading
Loading