Skip to content

Commit

Permalink
Drop SQL language syntax from Zed language
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnibs authored and nwt committed Apr 26, 2024
1 parent f0311c2 commit 711bf79
Show file tree
Hide file tree
Showing 20 changed files with 5,472 additions and 8,253 deletions.
41 changes: 0 additions & 41 deletions compiler/ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ func (*MapExpr) ExprAST() {}

func (*OverExpr) ExprAST() {}

func (*SQLExpr) ExprAST() {}

type ConstDecl struct {
Kind string `json:"kind" unpack:""`
Name string `json:"name"`
Expand Down Expand Up @@ -390,24 +388,6 @@ type (
Kind string `json:"kind" unpack:""`
Expr Expr `json:"expr"`
}
// A SQLExpr can be an operator, an expression inside of a SQL FROM clause,
// or an expression used as a Zed value generator. Currenly, the "select"
// keyword collides with the select() generator function (it can be parsed
// unambiguosly because of the parens but this is not user friendly
// so we need a new name for select()... see issue #2133).
// TBD: from alias, "in" over tuples, WITH sub-queries, multi-table FROM
// implying a JOIN, aliases for tables in FROM and JOIN.
SQLExpr struct {
Kind string `json:"kind" unpack:""`
Select []Assignment `json:"select"`
From *SQLFrom `json:"from"`
Joins []SQLJoin `json:"joins"`
Where Expr `json:"where"`
GroupBy []Expr `json:"group_by"`
Having Expr `json:"having"`
OrderBy *SQLOrderBy `json:"order_by"`
Limit int `json:"limit"`
}
Shape struct {
Kind string `json:"kind" unpack:""`
}
Expand Down Expand Up @@ -489,25 +469,6 @@ type Case struct {
Path Seq `json:"path"`
}

type SQLFrom struct {
Table Expr `json:"table"`
Alias Expr `json:"alias"`
}

type SQLOrderBy struct {
Kind string `json:"kind" unpack:""`
Keys []Expr `json:"keys"`
Order order.Which `json:"order"`
}

type SQLJoin struct {
Table Expr `json:"table"`
Style string `json:"style"`
LeftKey Expr `json:"left_key"`
RightKey Expr `json:"right_key"`
Alias Expr `json:"alias"`
}

type Assignment struct {
Kind string `json:"kind" unpack:""`
LHS Expr `json:"lhs"`
Expand Down Expand Up @@ -552,8 +513,6 @@ func (*Sample) OpAST() {}
func (*Load) OpAST() {}
func (*Assert) OpAST() {}

func (*SQLExpr) OpAST() {}

func (seq *Seq) Prepend(front Op) {
*seq = append([]Op{front}, *seq...)
}
Expand Down
2 changes: 0 additions & 2 deletions compiler/ast/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ var unpacker = unpack.New(
astzed.Set{},
SetExpr{},
Spread{},
SQLExpr{},
SQLOrderBy{},
SliceExpr{},
Sort{},
String{},
Expand Down
Loading

0 comments on commit 711bf79

Please sign in to comment.