MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / isDataTypeKeyword

Method isDataTypeKeyword

pkg/sql/parser/expressions.go:360–376  ·  view source on GitHub ↗

isDataTypeKeyword checks if current token is a SQL data type keyword

()

Source from the content-addressed store, hash-verified

358
359// isDataTypeKeyword checks if current token is a SQL data type keyword
360func (p *Parser) isDataTypeKeyword() bool {
361 // Check Type for known data type tokens
362 switch p.currentToken.Token.Type {
363 case models.TokenTypeInt, models.TokenTypeInteger, models.TokenTypeVarchar,
364 models.TokenTypeText, models.TokenTypeBoolean, models.TokenTypeFloat,
365 models.TokenTypeInterval:
366 return true
367 }
368 // Fallback: check literal for data type keywords not all represented in models
369 switch strings.ToUpper(p.currentToken.Token.Value) {
370 case "INT", "INTEGER", "BIGINT", "SMALLINT", "FLOAT", "DOUBLE", "DECIMAL",
371 "NUMERIC", "VARCHAR", "CHAR", "TEXT", "BOOLEAN", "DATE", "TIME",
372 "TIMESTAMP", "INTERVAL", "BLOB", "CLOB", "JSON", "UUID":
373 return true
374 }
375 return false
376}
377
378// isJSONOperator checks if current token is a JSON/JSONB operator
379func (p *Parser) isJSONOperator() bool {

Callers 1

parseDataTypeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected