MCPcopy Create free account
hub / github.com/dolthub/doltgresql / nodeWhere

Function nodeWhere

server/ast/where.go:26–47  ·  view source on GitHub ↗

nodeWhere handles *tree.Where nodes.

(ctx *Context, node *tree.Where)

Source from the content-addressed store, hash-verified

24
25// nodeWhere handles *tree.Where nodes.
26func nodeWhere(ctx *Context, node *tree.Where) (*vitess.Where, error) {
27 if node == nil {
28 return nil, nil
29 }
30 expr, err := nodeExpr(ctx, node.Expr)
31 if err != nil {
32 return nil, err
33 }
34 var whereType string
35 switch node.Type {
36 case tree.AstWhere:
37 whereType = vitess.WhereStr
38 case tree.AstHaving:
39 whereType = vitess.HavingStr
40 default:
41 return nil, errors.Errorf("WHERE-type statement not yet supported: `%s`", node.Type)
42 }
43 return &vitess.Where{
44 Type: whereType,
45 Expr: expr,
46 }, nil
47}

Callers 3

nodeSelectClauseFunction · 0.85
nodeUpdateFunction · 0.85
nodeDeleteFunction · 0.85

Calls 2

nodeExprFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected