MCPcopy Index your code
hub / github.com/donatj/sqlread / parseSelectIntoOutfileBuilder

Method parseSelectIntoOutfileBuilder

query.go:220–254  ·  view source on GitHub ↗
(qry *Query)

Source from the content-addressed store, hash-verified

218}
219
220func (q *QueryParser) parseSelectIntoOutfileBuilder(qry *Query) parseState {
221 return func(p *Parser) parseState {
222 c, ok := p.scan()
223 if !ok {
224 p.errorUnexpectedEOF()
225 return nil
226 }
227
228 if c.Type != TString {
229 p.errorUnexpectedLex(c, TString)
230 return nil
231 }
232
233 s, err := stringValue(c)
234 if err != nil {
235 p.err = err
236 return nil
237 }
238
239 qry.Outfile = &s
240
241 d, ok := p.scan()
242 if !ok {
243 p.errorUnexpectedEOF()
244 return nil
245 }
246 if d.Type == TSemi {
247 q.Tree.Queries = append(q.Tree.Queries, *qry)
248 return nil
249 }
250
251 p.errorUnexpectedLex(d, TSemi)
252 return nil
253 }
254}
255
256func identValue(c LexItem) string {
257 // remove backticks - if/when we implement backtickless

Callers 1

Calls 4

stringValueFunction · 0.85
scanMethod · 0.80
errorUnexpectedEOFMethod · 0.80
errorUnexpectedLexMethod · 0.80

Tested by

no test coverage detected