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

Method parseOneWithDepth

postgres/parser/parser/parse.go:119–130  ·  view source on GitHub ↗
(depth int, sql string)

Source from the content-addressed store, hash-verified

117}
118
119func (p *Parser) parseOneWithDepth(depth int, sql string) (Statement, error) {
120 stmts, err := p.parseWithDepth(1, sql, defaultNakedIntType)
121 if err != nil {
122 return Statement{}, err
123 }
124 if len(stmts) > 1 {
125 return Statement{}, errors.AssertionFailedf("expected 1 statement, but found %d", len(stmts))
126 } else if len(stmts) == 0 {
127 return Statement{}, vitess.ErrEmpty
128 }
129 return stmts[0], nil
130}
131
132func (p *Parser) scanOneStmt(parse func(sqlStr string, tokens []sqlSymType) error) bool {
133 var lval sqlSymType

Callers 1

ParseOneFunction · 0.95

Calls 1

parseWithDepthMethod · 0.95

Tested by

no test coverage detected