Documentation
¶
Index ¶
- func FromClauseHasJoinWithoutOn(fromClause *Node, src string) bool
- func LastPipeOperatorEnd(src string) (uint, bool)
- func SelectListItemOnNextLine(src string, offset uint) (wordStart, wordEnd uint, ok bool)
- func SkipComment(sql string, start int) int
- func SkipQuoted(sql string, start int) (end int, closed bool)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromClauseHasJoinWithoutOn ¶
FromClauseHasJoinWithoutOn reports whether fromClause contains a JOIN keyword not matched by an ON condition, by scanning tokens at depth 0.
func LastPipeOperatorEnd ¶ added in v0.8.1
LastPipeOperatorEnd returns the end offset of the last pipe operator "|>" in src that belongs to the query open at the end of src, that is, the pipe operator is in the same statement and at the same parenthesis depth.
func SelectListItemOnNextLine ¶ added in v0.8.8
SelectListItemOnNextLine reports the word before the select list item that the token at offset belongs to, when the item starts a line and that word ends the line before. Such a word is likely being typed in front of an existing item, still without its comma.
func SkipComment ¶ added in v0.8.9
SkipComment returns the offset after the comment starting at sql[start], or start when no comment starts there. An unterminated block comment runs to the end of sql.
func SkipQuoted ¶ added in v0.8.9
SkipQuoted returns the offset after the string literal or backtick identifier starting at sql[start], and whether it is terminated. An unterminated one runs to the end of sql.
Only ' and " open triple-quoted strings, since GoogleSQL has no triple-backtick identifiers. Backslashes always skip the next byte: in GoogleSQL even raw strings cannot be terminated by an escaped quote, so raw/bytes prefixes need no special case.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents an AST node for BigQuery SQL.