sql

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(errorListener *ErrorListenerImpl, query string) *parser.SQLiteParser

Create returns a new SQLiteParserParser for the given query string.

Types

type ErrorListenerImpl

type ErrorListenerImpl struct {
	*antlr.DefaultErrorListener
	Count int
	Error error
}

ErrorListenerImpl is an antlr.ErrorListener, and it tracks errors when parsing the SQL query string.

func (*ErrorListenerImpl) SyntaxError

func (el *ErrorListenerImpl) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type ListenerImpl

type ListenerImpl struct {
	parser.BaseSQLiteParserListener

	TableName            string
	Columns              []string
	ComparisonPredicates map[string]interface{}
	ColumnAliases        map[string]string
	// contains filtered or unexported fields
}

ListenerImpl is a parser.SQLiteParserListener, and holds all the tokens parsed from the SQL query, which are needed to construct a query against the Kubernetes API.

func (*ListenerImpl) ExitColumn_alias added in v0.2.0

func (l *ListenerImpl) ExitColumn_alias(ctx *parser.Column_aliasContext)

ExitColumn_alias is called when production column_alias is exited.

func (*ListenerImpl) ExitColumn_name added in v0.2.0

func (l *ListenerImpl) ExitColumn_name(ctx *parser.Column_nameContext)

ExitColumn_name is called when production column_name is exited.

func (*ListenerImpl) ExitExpr added in v0.2.0

func (l *ListenerImpl) ExitExpr(ctx *parser.ExprContext)

ExitExpr is called when production expr is exited.

func (*ListenerImpl) ExitLiteral_value added in v0.2.0

func (l *ListenerImpl) ExitLiteral_value(ctx *parser.Literal_valueContext)

ExitLiteral_value is called when production literal_value is exited.

func (*ListenerImpl) ExitResult_column added in v0.2.0

func (l *ListenerImpl) ExitResult_column(ctx *parser.Result_columnContext)

ExitResult_column is called when production result_column is exited.

func (*ListenerImpl) ExitTable_name added in v0.2.0

func (l *ListenerImpl) ExitTable_name(ctx *parser.Table_nameContext)

ExitTable_name is called when production table_name is exited.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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