Versions in this module Expand all Collapse all v0 v0.1.0 Nov 3, 2026 Changes in this version + const ABORT_P + const ABSENT + const ABSOLUTE_P + const ACCESS + const ACTION + const ADD_P + const ADMIN + const AFTER + const AGGREGATE + const ALL + const ALSO + const ALTER + const ALWAYS + const ANALYSE + const ANALYZE + const AND + const ANY + const ARRAY + const AS + const ASC + const ASENSITIVE + const ASSERTION + const ASSIGNMENT + const ASYMMETRIC + const AT + const ATOMIC + const ATTACH + const ATTRIBUTE + const AUTHORIZATION + const BACKWARD + const BCONST + const BEFORE + const BEGIN_P + const BETWEEN + const BIGINT + const BINARY + const BIT + const BOOLEAN_P + const BOTH + const BREADTH + const BY + const CACHE + const CALL + const CALLED + const CASCADE + const CASCADED + const CASE + const CAST + const CATALOG_P + const CHAIN + const CHARACTER + const CHARACTERISTICS + const CHAR_P + const CHECK + const CHECKPOINT + const CLASS + const CLOSE + const CLUSTER + const COALESCE + const COLLATE + const COLLATION + const COLON_EQUALS + const COLUMN + const COLUMNS + const COMMENT + const COMMENTS + const COMMIT + const COMMITTED + const COMPRESSION + const CONCURRENTLY + const CONDITIONAL + const CONFIGURATION + const CONFLICT + const CONNECTION + const CONSTRAINT + const CONSTRAINTS + const CONTENT_P + const CONTINUE_P + const CONVERSION_P + const COPY + const COST + const CREATE + const CROSS + const CSV + const CUBE + const CURRENT_CATALOG + const CURRENT_DATE + const CURRENT_P + const CURRENT_ROLE + const CURRENT_SCHEMA + const CURRENT_TIME + const CURRENT_TIMESTAMP + const CURRENT_USER + const CURSOR + const CYCLE + const ColNameKeyword + const DATABASE + const DATA_P + const DAY_P + const DEALLOCATE + const DEC + const DECIMAL_P + const DECLARE + const DEFAULT + const DEFAULTS + const DEFERRABLE + const DEFERRED + const DEFINER + const DELETE_P + const DELIMITER + const DELIMITERS + const DEPENDS + const DEPTH + const DESC + const DETACH + const DICTIONARY + const DISABLE_P + const DISCARD + const DISTINCT + const DO + const DOCUMENT_P + const DOMAIN_P + const DOT_DOT + const DOUBLE_P + const DROP + const EACH + const ELSE + const EMPTY + const EMPTY_P + const ENABLE_P + const ENCODING + const ENCRYPTED + const END_P + const ENUM_P + const EOF + const EQUALS_GREATER + const ERROR + const ERROR_P + const ESCAPE + const EVENT + const EXCEPT + const EXCLUDE + const EXCLUDING + const EXCLUSIVE + const EXECUTE + const EXISTS + const EXPLAIN + const EXPORT + const EXPRESSION + const EXTENSION + const EXTERNAL + const EXTRACT + const FALSE_P + const FAMILY + const FCONST + const FETCH + const FILTER + const FINALIZE + const FIRST_P + const FLOAT_P + const FOLLOWING + const FOR + const FORCE + const FOREIGN + const FORMAT + const FORMAT_LA + const FORWARD + const FREEZE + const FROM + const FULL + const FUNCTION + const FUNCTIONS + const GENERATED + const GLOBAL + const GRANT + const GRANTED + const GREATER_EQUALS + const GREATEST + const GROUPING + const GROUPS + const GROUP_P + const HANDLER + const HAVING + const HEADER_P + const HOLD + const HOUR_P + const ICONST + const IDENT + const IDENTITY_P + const IF_P + const ILIKE + const IMMEDIATE + const IMMUTABLE + const IMPLICIT_P + const IMPORT_P + const INCLUDE + const INCLUDING + const INCREMENT + const INDENT + const INDEX + const INDEXES + const INHERIT + const INHERITS + const INITIALLY + const INLINE_P + const INNER_P + const INOUT + const INPUT_P + const INSENSITIVE + const INSERT + const INSTEAD + const INTEGER + const INTERSECT + const INTERVAL + const INTO + const INT_P + const INVALID + const INVOKER + const IN_P + const IS + const ISNULL + const ISOLATION + const JOIN + const JSON + const JSON_ARRAY + const JSON_ARRAYAGG + const JSON_EXISTS + const JSON_OBJECT + const JSON_OBJECTAGG + const JSON_QUERY + const JSON_SCALAR + const JSON_SERIALIZE + const JSON_TABLE + const JSON_VALUE + const KEEP + const KEY + const KEYS + const LABEL + const LANGUAGE + const LARGE_P + const LAST_P + const LATERAL_P + const LEADING + const LEAKPROOF + const LEAST + const LEFT + const LESS_EQUALS + const LEVEL + const LIKE + const LIMIT + const LISTEN + const LOAD + const LOCAL + const LOCALTIME + const LOCALTIMESTAMP + const LOCATION + const LOCKED + const LOCK_P + const LOGGED + const MAPPING + const MATCH + const MATCHED + const MATERIALIZED + const MAXVALUE + const MERGE + const MERGE_ACTION + const METHOD + const MIGRATION + const MINUTE_P + const MINVALUE + const MODE + const MODE_PLPGSQL_ASSIGN1 + const MODE_PLPGSQL_ASSIGN2 + const MODE_PLPGSQL_ASSIGN3 + const MODE_PLPGSQL_EXPR + const MODE_TYPE_NAME + const MONTH_P + const MOVE + const NAMEDATALEN + const NAMES + const NAME_P + const NATIONAL + const NATURAL + const NCHAR + const NESTED + const NEW + const NEXT + const NFC + const NFD + const NFKC + const NFKD + const NO + const NONE + const NORMALIZE + const NORMALIZED + const NOT + const NOTHING + const NOTIFY + const NOTNULL + const NOT_EQUALS + const NOT_LA + const NOWAIT + const NULLIF + const NULLS_LA + const NULLS_P + const NULL_P + const NUMERIC + const OBJECT_P + const OF + const OFF + const OFFSET + const OIDS + const OLD + const OMIT + const ON + const ONLY + const OPERATOR + const OPTION + const OPTIONS + const OR + const ORDER + const ORDINALITY + const OTHERS + const OUTER_P + const OUT_P + const OVER + const OVERLAPS + const OVERLAY + const OVERRIDING + const OWNED + const OWNER + const Op + const PARALLEL + const PARAM + const PARAMETER + const PARSER + const PARTIAL + const PARTITION + const PASSING + const PASSWORD + const PATH + const PHASE + const PLACING + const PLAN + const PLANS + const POLICY + const POSITION + const PRECEDING + const PRECISION + const PREPARE + const PREPARED + const PRESERVE + const PRIMARY + const PRIOR + const PRIVILEGES + const PROCEDURAL + const PROCEDURE + const PROCEDURES + const PROGRAM + const PUBLICATION + const QUOTE + const QUOTES + const RANGE + const READ + const REAL + const REASSIGN + const RECHECK + const RECURSIVE + const REFERENCES + const REFERENCING + const REFRESH + const REF_P + const REINDEX + const RELATIVE_P + const RELEASE + const RENAME + const REPEATABLE + const REPLACE + const REPLICA + const RESET + const RESHARD + const RESTART + const RESTRICT + const RETURN + const RETURNING + const RETURNS + const REVOKE + const RIGHT + const ROLE + const ROLLBACK + const ROLLUP + const ROUTINE + const ROUTINES + const ROW + const ROWS + const RULE + const ReservedKeyword + const SAVEPOINT + const SCALAR + const SCHEMA + const SCHEMAS + const SCONST + const SCROLL + const SEARCH + const SECOND_P + const SECURITY + const SELECT + const SEQUENCE + const SEQUENCES + const SERIALIZABLE + const SERVER + const SESSION + const SESSION_USER + const SET + const SETOF + const SETS + const SHARDS + const SHARE + const SHOW + const SIMILAR + const SIMPLE + const SKIP + const SMALLINT + const SNAPSHOT + const SOME + const SOURCE + const SQLStateFeatureNotSupported + const SQLStateInvalidEscapeSequence + const SQL_P + const STABLE + const STANDALONE_P + const START + const STATEMENT + const STATISTICS + const STDIN + const STDOUT + const STORAGE + const STORED + const STRICT_P + const STRING_P + const STRIP_P + const SUBSCRIPTION + const SUBSTRING + const SUPPORT + const SYMMETRIC + const SYSID + const SYSTEM_P + const SYSTEM_USER + const TABLE + const TABLEGROUP + const TABLES + const TABLESAMPLE + const TABLESPACE + const TARGET + const TEMP + const TEMPLATE + const TEMPORARY + const TEXT_P + const THEN + const TIES + const TIME + const TIMESTAMP + const TO + const TRAILING + const TRANSACTION + const TRANSFORM + const TREAT + const TRIGGER + const TRIM + const TRUE_P + const TRUNCATE + const TRUSTED + const TYPECAST + const TYPES_P + const TYPE_P + const TypeFuncNameKeyword + const UESCAPE + const UIDENT + const UMINUS + const UNBOUNDED + const UNCOMMITTED + const UNCONDITIONAL + const UNENCRYPTED + const UNION + const UNIQUE + const UNKNOWN + const UNLISTEN + const UNLOGGED + const UNTIL + const UPDATE + const USCONST + const USER + const USING + const UTF8 + const UnreservedKeyword + const VACUUM + const VALID + const VALIDATE + const VALIDATOR + const VALUES + const VALUE_P + const VARCHAR + const VARIADIC + const VARYING + const VERBOSE + const VERSION_P + const VIEW + const VIEWS + const VOLATILE + const WHEN + const WHERE + const WHITESPACE_P + const WINDOW + const WITH + const WITHIN + const WITHOUT + const WITHOUT_LA + const WITH_LA + const WORK + const WRAPPER + const WRITE + const XCONST + const XMLATTRIBUTES + const XMLCONCAT + const XMLELEMENT + const XMLEXISTS + const XMLFOREST + const XMLNAMESPACES + const XMLPARSE + const XMLPI + const XMLROOT + const XMLSERIALIZE + const XMLTABLE + const XML_P + const YEAR_P + const YES_P + const ZONE + var Keywords = []KeywordInfo + func AssertLexerContextError(t *testing.T, lexer *Lexer, expectedErrorType LexerErrorType) + func AssertLexerHasErrors(t *testing.T, lexer *Lexer) + func AssertNoLexerErrors(t *testing.T, lexer *Lexer) + func AssertParseSQL(t *testing.T, sql string, expectedStmtCount int) []ast.Stmt + func AssertRoundTripSQL(t *testing.T, sql string, expectedSQL string) + func AssertTokenPosition(t *testing.T, token *Token, expectedPosition int) + func AssertTokenSequence(t *testing.T, input string, expectedTypes []TokenType) + func AssertTokenTypes(t *testing.T, tokens []Token, expectedTypes []TokenType) + func AssertTokenTypesAndValues(t *testing.T, tokens []Token, expected []struct{ ... }) + func AssertTokenValues(t *testing.T, tokens []Token, expectedValues []string) + func CalculateLineColumn(input []byte, pos int) (line, column int) + func CalculateUnicodePosition(input []byte, bytePos int) int + func GetKeywordNames() []string + func HasCharClass(b byte, class CharClass) bool + func IsAlpha(b byte) bool + func IsAlphaNumeric(b byte) bool + func IsBinaryDigit(b byte) bool + func IsDigit(b byte) bool + func IsHexDigit(b byte) bool + func IsHighBit(b byte) bool + func IsIdentCont(b byte) bool + func IsIdentStart(b byte) bool + func IsKeyword(name string) bool + func IsOctalDigit(b byte) bool + func IsOpChar(b byte) bool + func IsReservedKeyword(name string) bool + func IsSelfChar(b byte) bool + func IsWhitespace(b byte) bool + func ParseSQL(input string) ([]ast.Stmt, error) + func ParseSQLWithStandardConformingStrings(input string, standardConformingStrings bool) ([]ast.Stmt, error) + func SanitizeNearText(text string, maxLen int) string + func SplitColQualList(qualList *ast.NodeList) (*ast.NodeList, *ast.CollateClause) + type BackslashQuoteMode int + const BackslashQuoteOff + const BackslashQuoteOn + const BackslashQuoteSafeEncoding + type CharClass uint16 + const ClassAlpha + const ClassBinaryDigit + const ClassDigit + const ClassHexDigit + const ClassHighBit + const ClassIdentCont + const ClassIdentStart + const ClassOctalDigit + const ClassOpChar + const ClassSelfChar + const ClassWhitespace + func GetCharClass(b byte) CharClass + type ErrorRecovery struct + CanContinue bool + RecoveryAction string + RecoveryHint string + SuggestedFix string + type ErrorSeverity int + const ErrorSeverityError + const ErrorSeverityFatal + const ErrorSeverityNotice + const ErrorSeverityPanic + const ErrorSeverityWarning + func (es ErrorSeverity) String() string + type ImportQual struct + type KeywordCategory = ast.KeywordCategory + type KeywordInfo struct + CanBareLabel bool + Category KeywordCategory + Name string + TokenType int + func GetKeywordsByCategory(category KeywordCategory) []KeywordInfo + func LookupKeyword(name string) *KeywordInfo + type Lexer struct + func NewLexer(input string) *Lexer + func NewLexerWithOptions(input string, options *ParseOptions) *Lexer + func (l *Lexer) Error(s string) + func (l *Lexer) ErrorWithHint(msg, hint string) + func (l *Lexer) ErrorWithHintState(msg, hint, sqlState string) + func (l *Lexer) FirstError() *ParseSyntaxError + func (l *Lexer) GetContext() *ParseContext + func (l *Lexer) GetErrors() []error + func (l *Lexer) GetParseTree() []ast.Stmt + func (l *Lexer) GetPosition() int + func (l *Lexer) HasErrors() bool + func (l *Lexer) Lex(lval *yySymType) int + func (l *Lexer) NextToken() *Token + func (l *Lexer) RecordError(err error) + func (l *Lexer) SetParseTree(tree []ast.Stmt) + func (l *Lexer) String() string + type LexerError struct + AtEOF bool + Column int + Context string + ErrorLength int + Hint string + Line int + Message string + NearText string + Position int + Type LexerErrorType + func (e *LexerError) DetailedError() string + func (e *LexerError) Error() string + func (e *LexerError) GetRecoveryStrategy() ErrorRecovery + func (e *LexerError) PostgreSQLErrorMessage() string + type LexerErrorType int + const InvalidBinaryInteger + const InvalidEscape + const InvalidHexInteger + const InvalidNumber + const InvalidOctalInteger + const InvalidUnicode + const InvalidUnicodeEscape + const InvalidUnicodeSurrogatePair + const OperatorTooLong + const SyntaxError + const TrailingJunk + const TrailingJunkAfterParameter + const UnsupportedEscapeSequence + const UnterminatedBitString + const UnterminatedComment + const UnterminatedDollarQuote + const UnterminatedHexString + const UnterminatedIdentifier + const UnterminatedString + const ZeroLengthIdentifier + type LexerInterface interface + Error func(s string) + Lex func(lval *yySymType) int + type LexerState int + const StateInitial + const StateXB + const StateXC + const StateXD + const StateXDolQ + const StateXE + const StateXEU + const StateXH + const StateXQ + const StateXQS + const StateXUI + const StateXUS + type ParseContext struct + func NewLexerContext(input string) *ParseContext + func NewParseContext(input string, options *ParseOptions) *ParseContext + func (ctx *ParseContext) AddError(message string, location int) *ParseError + func (ctx *ParseContext) AddErrorWithType(errorType LexerErrorType, message string) *ParseError + func (ctx *ParseContext) AddLexerErrorAt(message, hint string, location int) *ParseError + func (ctx *ParseContext) AddLexerErrorAtDetailState(message, detail, hint, sqlState string, location int) *ParseError + func (ctx *ParseContext) AddLexerErrorAtState(message, hint, sqlState string, location int) *ParseError + func (ctx *ParseContext) AddLexerErrorNear(errorType LexerErrorType, message, lexeme string, location int) *ParseError + func (ctx *ParseContext) AddLiteral(text string) + func (ctx *ParseContext) AddLiteralByte(b byte) + func (ctx *ParseContext) AddSyntaxError(message string) *ParseError + func (ctx *ParseContext) AddSyntaxErrorHint(message, hint string) *ParseError + func (ctx *ParseContext) AddSyntaxErrorHintState(message, hint, sqlState string) *ParseError + func (ctx *ParseContext) AddWarning(message string, location int) *ParseError + func (ctx *ParseContext) AdvanceBy(n int) + func (ctx *ParseContext) AdvanceRune() rune + func (ctx *ParseContext) AtEOF() bool + func (ctx *ParseContext) ClearErrors() + func (ctx *ParseContext) Clone() *ParseContext + func (ctx *ParseContext) ColumnNumber() int + func (ctx *ParseContext) CurrentByte() (byte, bool) + func (ctx *ParseContext) CurrentChar() rune + func (ctx *ParseContext) CurrentPosition() int + func (ctx *ParseContext) CurrentRune() (rune, int) + func (ctx *ParseContext) DecrementDepth() + func (ctx *ParseContext) DolQStart() string + func (ctx *ParseContext) Errors() []ParseError + func (ctx *ParseContext) GetContextID() string + func (ctx *ParseContext) GetCurrentPos() int + func (ctx *ParseContext) GetCurrentPosition() (pos int, line int, col int) + func (ctx *ParseContext) GetCurrentText(startPos int) string + func (ctx *ParseContext) GetDepth() int + func (ctx *ParseContext) GetErrors() []ParseError + func (ctx *ParseContext) GetLiteral() string + func (ctx *ParseContext) GetOptions() *ParseOptions + func (ctx *ParseContext) GetParseTree() ast.Node + func (ctx *ParseContext) GetScanBuf() []byte + func (ctx *ParseContext) GetScanBufLen() int + func (ctx *ParseContext) GetScanPos() int + func (ctx *ParseContext) GetSourceText() string + func (ctx *ParseContext) GetState() LexerState + func (ctx *ParseContext) GetState2() LexerState + func (ctx *ParseContext) GetStatementBoundaries() (int, int) + func (ctx *ParseContext) GetWarnings() []ParseError + func (ctx *ParseContext) HasErrors() bool + func (ctx *ParseContext) HasPrefixAtScanPos(needle string) bool + func (ctx *ParseContext) HasWarnings() bool + func (ctx *ParseContext) InMultiDotSequence() bool + func (ctx *ParseContext) IncrementDepth() error + func (ctx *ParseContext) LineNumber() int + func (ctx *ParseContext) LiteralActive() bool + func (ctx *ParseContext) NextByte() (byte, bool) + func (ctx *ParseContext) PeekBytes(n int) []byte + func (ctx *ParseContext) PeekChar() rune + func (ctx *ParseContext) PeekRune() rune + func (ctx *ParseContext) PeekToEnd() []byte + func (ctx *ParseContext) PutBack(n int) + func (ctx *ParseContext) RestoreSavedPosition() + func (ctx *ParseContext) SaveCurrentPosition() int + func (ctx *ParseContext) ScanBuf() []byte + func (ctx *ParseContext) ScanBufLen() int + func (ctx *ParseContext) ScanPos() int + func (ctx *ParseContext) SetColumnNumber(col int) + func (ctx *ParseContext) SetColumnNumber2(col int) + func (ctx *ParseContext) SetCurrentPosition(pos int, line int, col int) + func (ctx *ParseContext) SetCurrentPosition2(pos int) + func (ctx *ParseContext) SetDolQStart(value string) + func (ctx *ParseContext) SetInMultiDotSequence(value bool) + func (ctx *ParseContext) SetLastToken(token *Token) + func (ctx *ParseContext) SetLineNumber(line int) + func (ctx *ParseContext) SetLineNumber2(line int) + func (ctx *ParseContext) SetParseTree(tree ast.Node) + func (ctx *ParseContext) SetScanPos(pos int) + func (ctx *ParseContext) SetSourceText(sourceText string) + func (ctx *ParseContext) SetState(state LexerState) + func (ctx *ParseContext) SetStatementBoundaries(start int, end int) + func (ctx *ParseContext) SetUTF16FirstPart(value int32) + func (ctx *ParseContext) SetXCDepth(depth int) + func (ctx *ParseContext) StandardConformingStrings() bool + func (ctx *ParseContext) StartLiteral() + func (ctx *ParseContext) State() LexerState + func (ctx *ParseContext) String() string + func (ctx *ParseContext) UTF16FirstPart() int32 + func (ctx *ParseContext) XCDepth() int + type ParseError struct + AtEOF bool + Column int + Context string + ErrorLength int + Line int + Message string + NearText string + Position int + SQLState string + Severity ErrorSeverity + SourceText string + Type LexerErrorType + WireDetail string + WireHint string + func (pe *ParseError) CursorPosition() int32 + func (pe *ParseError) Error() string + type ParseOptions struct + BackslashQuote BackslashQuoteMode + CollectAllErrors bool + EnableExtensions bool + EnableMergeStmt bool + EnablePartitioning bool + EnableWindowFuncs bool + EscapeStringWarning bool + MaxExpressionDepth int + MaxIdentifierLength int + MaxStatementLength int + StandardConformingStrings bool + StopOnFirstError bool + func DefaultParseOptions() *ParseOptions + type ParseSyntaxError struct + CursorPosition int32 + Detail string + Hint string + Message string + Position int + SQLState string + func (e *ParseSyntaxError) Error() string + type PrivTarget struct + type Token struct + Position int + Text string + Type int + Value TokenValue + func NewIntToken(value int, position int, text string) *Token + func NewKeywordToken(tokenType int, keyword string, position int, text string) *Token + func NewParamToken(paramNum int, position int, text string) *Token + func NewStringToken(tokenType int, value string, position int, text string) *Token + func NewToken(tokenType int, position int, text string) *Token + func ScanAllTokens(t *testing.T, lexer *Lexer) []Token + func (t *Token) IsBitStringLiteral() bool + func (t *Token) IsIdentifier() bool + func (t *Token) IsNumericLiteral() bool + func (t *Token) IsOperator() bool + func (t *Token) IsStringLiteral() bool + func (t *Token) String() string + type TokenType = int + type TokenValue struct + Ival int + Keyword string + Str string