MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / ParseOne

Function ParseOne

pkg/sql/parser/parse.go:249–251  ·  view source on GitHub ↗

ParseOne parses a sql statement string, ensuring that it contains only a single statement, and returns that Statement. ParseOne will always interpret the INT and SERIAL types as 64-bit types, since this is used in various internal-execution paths where we might receive bits of SQL from other nodes.

(sql string)

Source from the content-addressed store, hash-verified

247// bits of SQL from other nodes. In general, we expect that all
248// user-generated SQL has been run through the ParseWithInt() function.
249func ParseOne(sql string) (statements.Statement[tree.Statement], error) {
250 return ParseOneWithInt(sql, defaultNakedIntType)
251}
252
253// ParseOneRetainComments is similar to ParseOne, but it retains scanned
254// comments in the returned statement's Comment field.

Callers 7

TestParserFunction · 0.92
MakeExecSqlStmtMethod · 0.92
MakeFetchOrMoveStmtMethod · 0.92
ParseReturnQueryMethod · 0.92
ParseTableNameFunction · 0.85
ParseFunctionNameFunction · 0.85
ParseTablePatternFunction · 0.85

Calls 1

ParseOneWithIntFunction · 0.85

Tested by 1

TestParserFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…