Skip to content

Commit

Permalink
remove unrelated funcs that got merged-in
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Jun 13, 2024
1 parent 69ccd58 commit 25cbcae
Showing 1 changed file with 0 additions and 128 deletions.
128 changes: 0 additions & 128 deletions go/vt/sqlparser/ast_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,72 +654,6 @@ func NewColNameWithQualifier(identifier string, table TableName) *ColName {
}
}

// NewTableName makes a new TableName
func NewTableName(name string) TableName {
return TableName{
Name: NewIdentifierCS(name),
}
}

// NewTableNameWithQualifier makes a new TableName with a qualifier
func NewTableNameWithQualifier(name, qualifier string) TableName {
return TableName{
Name: NewIdentifierCS(name),
Qualifier: NewIdentifierCS(qualifier),
}
}

// NewSubquery makes a new Subquery
func NewSubquery(selectStatement SelectStatement) *Subquery {
return &Subquery{Select: selectStatement}
}

// NewDerivedTable makes a new DerivedTable
func NewDerivedTable(lateral bool, selectStatement SelectStatement) *DerivedTable {
return &DerivedTable{
Lateral: lateral,
Select: selectStatement,
}
}

// NewAliasedTableExpr makes a new AliasedTableExpr with an alias
func NewAliasedTableExpr(simpleTableExpr SimpleTableExpr, alias string) *AliasedTableExpr {
return &AliasedTableExpr{
Expr: simpleTableExpr,
As: NewIdentifierCS(alias),
}
}

// NewJoinTableExpr makes a new JoinTableExpr
func NewJoinTableExpr(leftExpr TableExpr, join JoinType, rightExpr TableExpr, condition *JoinCondition) *JoinTableExpr {
return &JoinTableExpr{
LeftExpr: leftExpr,
Join: join,
RightExpr: rightExpr,
Condition: condition,
}
}

// NewJoinCondition makes a new JoinCondition
func NewJoinCondition(on Expr, using Columns) *JoinCondition {
return &JoinCondition{
On: on,
Using: using,
}
}

// NewAliasedExpr makes a new AliasedExpr
func NewAliasedExpr(expr Expr, alias string) *AliasedExpr {
return &AliasedExpr{
Expr: expr,
As: NewIdentifierCI(alias),
}
}

func (ae *AliasedExpr) SetAlias(alias string) {
ae.As = NewIdentifierCI(alias)
}

func createAliasForEmpty(selectExpr SelectExpr, alias string) {
switch node := selectExpr.(type) {
case *AliasedExpr:
Expand All @@ -738,68 +672,6 @@ func createAliasForEmpty(selectExpr SelectExpr, alias string) {
}
}

// NewOrder makes a new Order
func NewOrder(expr Expr, direction OrderDirection) *Order {
return &Order{
Expr: expr,
Direction: direction,
}
}

// NewNotExpr makes a new NotExpr
func NewNotExpr(expr Expr) *NotExpr {
return &NotExpr{Expr: expr}
}

// NewComparisonExpr makes a new ComparisonExpr
func NewComparisonExpr(operator ComparisonExprOperator, left, right, escape Expr) *ComparisonExpr {
return &ComparisonExpr{
Operator: operator,
Left: left,
Right: right,
Escape: escape,
}
}

// NewExistsExpr makes a new ExistsExpr
func NewExistsExpr(subquery *Subquery) *ExistsExpr {
return &ExistsExpr{Subquery: subquery}
}

// NewCaseExpr makes a new CaseExpr
func NewCaseExpr(expr Expr, whens []*When, elseExpr Expr) *CaseExpr {
return &CaseExpr{
Expr: expr,
Whens: whens,
Else: elseExpr,
}
}

// NewLimit makes a new Limit
func NewLimit(offset, rowCount int) *Limit {
return &Limit{
Offset: &Literal{
Type: IntVal,
Val: fmt.Sprint(offset),
},
Rowcount: &Literal{
Type: IntVal,
Val: fmt.Sprint(rowCount),
},
}
}

// NewLimitWithoutOffset makes a new Limit without an offset
func NewLimitWithoutOffset(rowCount int) *Limit {
return &Limit{
Offset: nil,
Rowcount: &Literal{
Type: IntVal,
Val: fmt.Sprint(rowCount),
},
}
}

// NewSelect is used to create a select statement
func NewSelect(comments Comments, exprs SelectExprs, selectOptions []string, into *SelectInto, from TableExprs, where *Where, groupBy GroupBy, having *Where, windows NamedWindows) *Select {
var cache *bool
Expand Down

0 comments on commit 25cbcae

Please sign in to comment.