Skip to content

Commit

Permalink
sql/ast: add enum values for SetOperation
Browse files Browse the repository at this point in the history
This commit adds enum values for SetOperation. The values are extracted from
the parser sources in pg_query_go:

typedef enum SetOperation
{
    SETOP_NONE = 0,
    SETOP_UNION,
    SETOP_INTERSECT,
    SETOP_EXCEPT
} SetOperation;
  • Loading branch information
aitva committed Feb 14, 2021
1 parent 0c9db97 commit 3a58ee9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/sql/ast/set_operation.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
package ast

import "strconv"

const (
None SetOperation = iota
Union
Intersect
Except
)

type SetOperation uint

func (n *SetOperation) Pos() int {
return 0
}

func (n SetOperation) String() string {
switch n {
case None:
return "None"
case Union:
return "Union"
case Intersect:
return "Intersect"
case Except:
return "Except"
default:
return "Unknown(" + strconv.FormatUint(uint64(n), 10) + ")"
}
}

0 comments on commit 3a58ee9

Please sign in to comment.