scanner

package
v0.112.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package scanner implements a HANA SQL query scanner.

For a detailed HANA SQL query syntax please see https://help.sap.com/doc/6254b3bb439c4f409a979dc407b49c9b/2.0.00/en-US/SAP_HANA_SQL_Script_Reference_en.pdf

Index

Constants

This section is empty.

Variables

View Source
var ErrToken = errors.New("invalid token")

ErrToken is raised when a token is malformed (e.g. string with missing ending quote).

Functions

This section is empty.

Types

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

A Scanner implements reading of SQL query tokens.

func (*Scanner) Next

func (sc *Scanner) Next() (token Token, start, end int)

Next reads and returns the next token.

func (*Scanner) Reset

func (sc *Scanner) Reset(s string)

Reset initializes a Scanner with a new SQL statement.

type Token

type Token int

Token is the set of lexicals tokens of a SQL query.

const (
	EOS Token = iota
	Error
	Undefined
	Operator
	Delimiter
	IdentifierDelimiter
	Identifier
	QuotedIdentifier
	Variable
	PosVariable
	NamedVariable
	String
	Number
)

Token constants.

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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