Package dev.frostlake.executor.commands
Interface CommandHandler
- All Known Implementing Classes:
AlterCommandHandler,BeginEndBlockHandler,ColumnDefinitionParser,CommentCommandHandler,CreateInfrastructureHandler,CreateNamespaceHandler,CreateRelationalHandler,CreateRoutineHandler,CreateSecurityHandler,CreateTableHandler,DDLCommandHandler,DMLCommandHandler,DropCommandHandler,GrantRevokeHandler,QueryCommandHandler,ShowCommandHandler
public interface CommandHandler
Base interface for SQL command handlers
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringThe COLUMN-level flavour ofextractComment(FrostlakeParser.CommentClauseContext)—COMMENT '<text>'with no equals sign, the only spelling live accepts on a column.default StringExtract comment from comment clauseGet catalog instanceGet query executor instancedefault StringGet text from identifier or qualified name contextdefault Stringdefault String[]The identifier parts of a qualified name (db, schema, name), read from the parse tree instead of by splitting its flattened text on '.' — correct even for a quoted identifier containing a dot.
-
Method Details
-
getText
Get text from identifier or qualified name context- Parameters:
ctx- the identifier parse tree- Returns:
- the canonical name — unquoted identifiers folded to upper case, quoted ones verbatim
-
getText
-
qualifiedNameParts
The identifier parts of a qualified name (db, schema, name), read from the parse tree instead of by splitting its flattened text on '.' — correct even for a quoted identifier containing a dot.- Parameters:
ctx- the qualified-name parse tree- Returns:
- the canonical name parts in source order, one element per dotted level
-
extractComment
Extract comment from comment clause- Parameters:
ctx- theCOMMENT [=] '<text>'clause, or null when the statement carries none- Returns:
- the comment text with its single-quote or dollar-quote delimiters stripped, or null when the clause is absent
-
extractComment
The COLUMN-level flavour ofextractComment(FrostlakeParser.CommentClauseContext)—COMMENT '<text>'with no equals sign, the only spelling live accepts on a column.- Parameters:
ctx- the column's comment clause, or null when the column carries none- Returns:
- the comment text with its single-quote or dollar-quote delimiters stripped, or null when the clause is absent
-
getCatalog
Catalog getCatalog()Get catalog instance- Returns:
- the engine's metastore catalog, holding the objects this handler reads and mutates
-
getQueryExecutor
QueryExecutor getQueryExecutor()Get query executor instance- Returns:
- the engine's query executor, for handlers that run nested queries or need session state
-