Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Special tokens ILLEGAL = Type("ILLEGAL") EOF = Type("EOF") WS = Type("WS") // Identifiers and literals IDENT = Type("IDENT") // column, table_name INT = Type("INT") // 12345 FLOAT = Type("FLOAT") // 123.45 STRING = Type("STRING") // "abc", 'abc' TRUE = Type("TRUE") // TRUE FALSE = Type("FALSE") // FALSE // Operators EQ = Type("=") NEQ = Type("!=") NOT_EQ = Type("!=") // Alias for NEQ LT = Type("<") LTE = Type("<=") GT = Type(">") GTE = Type(">=") ASTERISK = Type("*") // Delimiters COMMA = Type(",") SEMICOLON = Type(";") LPAREN = Type("(") RPAREN = Type(")") DOT = Type(".") // Keywords SELECT = Type("SELECT") INSERT = Type("INSERT") UPDATE = Type("UPDATE") DELETE = Type("DELETE") FROM = Type("FROM") WHERE = Type("WHERE") ORDER = Type("ORDER") BY = Type("BY") GROUP = Type("GROUP") HAVING = Type("HAVING") LIMIT = Type("LIMIT") OFFSET = Type("OFFSET") AS = Type("AS") AND = Type("AND") OR = Type("OR") IN = Type("IN") NOT = Type("NOT") NULL = Type("NULL") ALL = Type("ALL") ON = Type("ON") INTO = Type("INTO") VALUES = Type("VALUES") // Role keywords SUPERUSER = Type("SUPERUSER") NOSUPERUSER = Type("NOSUPERUSER") CREATEDB = Type("CREATEDB") NOCREATEDB = Type("NOCREATEDB") CREATEROLE = Type("CREATEROLE") NOCREATEROLE = Type("NOCREATEROLE") LOGIN = Type("LOGIN") NOLOGIN = Type("NOLOGIN") // ALTER statement keywords ALTER = Type("ALTER") TABLE = Type("TABLE") ROLE = Type("ROLE") POLICY = Type("POLICY") CONNECTOR = Type("CONNECTOR") ADD = Type("ADD") DROP = Type("DROP") COLUMN = Type("COLUMN") CONSTRAINT = Type("CONSTRAINT") RENAME = Type("RENAME") TO = Type("TO") SET = Type("SET") RESET = Type("RESET") MEMBER = Type("MEMBER") OWNER = Type("OWNER") USER = Type("USER") URL = Type("URL") DCPROPERTIES = Type("DCPROPERTIES") CASCADE = Type("CASCADE") WITH = Type("WITH") CHECK = Type("CHECK") USING = Type("USING") UNTIL = Type("UNTIL") VALID = Type("VALID") PASSWORD = Type("PASSWORD") EQUAL = Type("=") )
Token types
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Token ¶
type Token struct {
Type Type // String-based type (backward compatibility)
ModelType models.TokenType // Int-based type (primary, for performance)
Literal string // The literal value of the token
}
Token represents a lexical token The Token struct supports both string-based (Type) and int-based (ModelType) type systems. ModelType is the primary system going forward, while Type is maintained for backward compatibility.
func NewTokenWithModelType ¶ added in v1.6.0
NewTokenWithModelType creates a token with both string and int types populated
func (Token) HasModelType ¶ added in v1.6.0
HasModelType returns true if the ModelType field is populated
func (Token) IsAnyType ¶ added in v1.6.0
IsAnyType checks if the token matches any of the given models.TokenType values
type Type ¶
type Type string
Type represents a token type (string-based, for backward compatibility)
func (Type) IsOperator ¶
IsOperator returns true if the token type is an operator
func (Type) ToModelType ¶ added in v1.6.0
ToModelType converts a string-based Type to models.TokenType
Click to show internal directories.
Click to hide internal directories.