{"modulePath":"github.com/cockroachdb/cockroachdb-parser","version":"v0.25.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package statements\n\n## Functions\n\n```go\nfunc IsANSIDML(stmt tree.Statement) bool\n```\nIsANSIDML returns true if the AST is one of the 4 DML statements, SELECT, UPDATE, INSERT, DELETE, or an EXPLAIN of one of these statements.\n\n## Types\n\n```go\ntype JsonpathStatement Statement[*jsonpath.Jsonpath]\n```\n\n```go\nfunc (stmt JsonpathStatement) String() string\n```\n\n```go\nfunc (stmt JsonpathStatement) StringWithFlags(flags tree.FmtFlags) string\n```\nStringWithFlags returns the AST formatted as a string (with the given flags).\n\n```go\ntype PLpgStatement Statement[*plpgsqltree.Block]\n```\n\n```go\nfunc (stmt PLpgStatement) String() string\n```\n\n```go\nfunc (stmt PLpgStatement) StringWithFlags(flags tree.FmtFlags) string\n```\nStringWithFlags returns the AST formatted as a string (with the given flags).\n\n```go\ntype ParsedStmts interface {\n\tString() string\n\tStringWithFlags(flags tree.FmtFlags) string\n}\n```\n\n```go\ntype Statement[T any] struct {\n\t// AST is the root of the AST tree for the parsed statement.\n\t// Note that it is NOT SAFE to access this currently with statement execution,\n\t// as unfortunately the AST is not immutable.\n\t// See issue https://github.com/cockroachdb/cockroachdb-parser/issues/22847 for more\n\t// details on this problem.\n\tAST T\n\n\t// Comments is the list of parsed SQL comments.\n\tComments []string\n\n\t// SQL is the original SQL from which the statement was parsed. Note that this\n\t// is not appropriate for use in logging, as it may contain passwords and\n\t// other sensitive data.\n\tSQL string\n\n\t// NumPlaceholders indicates the number of arguments to the statement (which\n\t// are referenced through placeholders). This corresponds to the highest\n\t// argument position (i.e. the x in \"$x\") that appears in the query.\n\t//\n\t// Note: where there are \"gaps\" in the placeholder positions, this number is\n\t// based on the highest position encountered. For example, for `SELECT $3`,\n\t// NumPlaceholders is 3. These cases are malformed and will result in a\n\t// type-check error.\n\tNumPlaceholders int\n\n\t// NumAnnotations indicates the number of annotations in the tree. It is equal\n\t// to the maximum annotation index.\n\tNumAnnotations tree.AnnotationIdx\n}\n```\nStatement is the result of parsing a single statement. It contains the AST node along with other information.\n\n```go\ntype Statements []Statement[tree.Statement]\n```\nStatements is a list of parsed statements.\n\n```go\nfunc (stmts Statements) String() string\n```\nString returns the AST formatted as a string.\n\n```go\nfunc (stmts Statements) StringWithFlags(flags tree.FmtFlags) string\n```\nStringWithFlags returns the AST formatted as a string (with the given flags).\n\n","path":"github.com/cockroachdb/cockroachdb-parser/pkg/sql/parser/statements","name":"statements","synopsis":"","isRedistributable":true}
