Discover Packages
github.com/jjeffery/sqlstmt
private
scanner
package
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Sep 14, 2016
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
scanner
Package scanner
implements a simple lexical scanner for SQL statements.
There is no backward compatibility guarantee for this package.
Expand ▾
Collapse ▴
Documentation
¶
Package scanner implements a simple lexical scanner
for SQL statements.
IsQuoted returns true if the identifier is a quoted identifier.
Quote the identifer using the start and end quote strings.
If the end quote string occurs in ident, it is escaped.
Unquote will unquote an identifier, if it is quoted.
If the syntax of the identifier is not valid the result is
undefined.
type Scanner struct {
IgnoreWhiteSpace bool
}
Scanner is a simple lexical scanner for SQL statements.
New returns a new scanner that takes its input from r.
AddKeywords informs the scanner of keywords. Keywords
are not case sensitive.
Err returns the first non-EOF error that was
encountered by the Scanner.
Text returns the token's text from the last scan.
Token returns the token from the last scan.
Token is a lexical token for SQL.
const (
ILLEGAL Token = iota
EOF
WS
IDENT
KEYWORD
LITERAL
OP
PLACEHOLDER
)
Tokens
Source Files
¶
Click to show internal directories.
Click to hide internal directories.