Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlparser

package
v0.23.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpToken

func DumpToken(token *sqllexer.Token) string

func IsIdentifierLikeToken

func IsIdentifierLikeToken(t *sqllexer.Token) bool

func PrintTokens

func PrintTokens(tokens []*sqllexer.Token) string

func ScanAllTokens

func ScanAllTokens(lexer *sqllexer.Lexer) []*sqllexer.Token

func SplitTokensIntoStatements

func SplitTokensIntoStatements(tokens []*sqllexer.Token) [][]*sqllexer.Token

func TokenName

func TokenName(tokenType sqllexer.TokenType) string

Types

type BaseParser

type BaseParser struct {
	Tokens []*sqllexer.Token
	Index  int
}

func (*BaseParser) ExpectToken

func (p *BaseParser) ExpectToken(token sqllexer.Token) error

func (*BaseParser) ParseIdentifier

func (p *BaseParser) ParseIdentifier() (string, error)

ParseIdentifier reads the name at the parser's position: the next identifier-like token, joined with the identifier-like tokens that follow it directly. A space or a comment ends the name, so the words after it (`PRODUCTS cluster by (...)`, `STREAM on table T`) are not read into it, except inside a quoted part: the lexer splits `DB."my schema".T` at the space when the name does not start with the quote.

func (*BaseParser) ParseToken

func (p *BaseParser) ParseToken(token sqllexer.Token) bool

func (*BaseParser) PeekToken

func (p *BaseParser) PeekToken() (int, *sqllexer.Token)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL