macro_rules! contextual_keywords {
($(
$(#[$meta:meta])*
$variant:ident => $text:literal,
)*) => {
#[derive(Clone, Copy, PartialEq, Eq)]
pub(crate) enum ContextualKeyword {
$(
$(#[$meta])*
$variant,
)*
}
impl ContextualKeyword {
pub(crate) fn text(self) -> &'static str {
match self {
$(
ContextualKeyword::$variant => $text,
)*
}
}
}
};
}
contextual_keywords! {
At => "at",
Before => "before",
Asof => "asof",
MatchCondition => "match_condition",
MatchRecognize => "match_recognize",
Grouping => "grouping",
Sets => "sets",
Measures => "measures",
Final => "final",
Running => "running",
Pattern => "pattern",
Define => "define",
Subset => "subset",
Match => "match",
One => "one",
Skip => "skip",
Past => "past",
Next => "next",
To => "to",
NoCycle => "nocycle",
Changes => "changes",
Comment => "comment",
Version => "version",
Timestamp => "timestamp",
Of => "of",
Location => "location",
Tblproperties => "tblproperties",
Options => "options",
Partitioned => "partitioned",
Transaction => "transaction",
Work => "work",
Atomic => "atomic",
Interval => "interval",
Year => "year",
Years => "years",
Month => "month",
Months => "months",
Week => "week",
Weeks => "weeks",
Day => "day",
Days => "days",
Hour => "hour",
Minute => "minute",
Minutes => "minutes",
Second => "second",
Seconds => "seconds",
Millisecond => "millisecond",
Milliseconds => "milliseconds",
Microsecond => "microsecond",
Microseconds => "microseconds",
Reverse => "reverse",
Default => "default",
Break => "break",
Continue => "continue",
Schema => "schema",
Database => "database",
Stage => "stage",
Put => "put",
Get => "get",
List => "list",
Remove => "remove",
Sequence => "sequence",
Stream => "stream",
Dynamic => "dynamic",
Semantic => "semantic",
File => "file",
Format => "format",
Masking => "masking",
Policy => "policy",
Access => "access",
Tag => "tag",
AllowedValues => "allowed_values",
Propagate => "propagate",
ExemptOtherPolicies => "exempt_other_policies",
Tables => "tables",
Relationships => "relationships",
Facts => "facts",
Dimensions => "dimensions",
Metrics => "metrics",
Public => "public",
Private => "private",
Synonyms => "synonyms",
Labels => "labels",
AiSqlGeneration => "ai_sql_generation",
AiQuestionCategorization => "ai_question_categorization",
AiVerifiedQueries => "ai_verified_queries",
Question => "question",
VerifiedAt => "verified_at",
OnboardingQuestion => "onboarding_question",
VerifiedBy => "verified_by",
Role => "role",
User => "user",
Share => "share",
Cascade => "cascade",
Restrict => "restrict",
Option => "option",
Privileges => "privileges",
Materialized => "materialized",
Local => "local",
Global => "global",
Cluster => "cluster",
Clone => "clone",
Shallow => "shallow",
Deep => "deep",
Distribute => "distribute",
Sort => "sort",
Primary => "primary",
Key => "key",
Unique => "unique",
Foreign => "foreign",
References => "references",
Constraint => "constraint",
Check => "check",
Collate => "collate",
Vacuum => "vacuum",
Retain => "retain",
Hours => "hours",
Dry => "dry",
Run => "run",
Optimize => "optimize",
Zorder => "zorder",
Cache => "cache",
Lazy => "lazy",
Uncache => "uncache",
Refresh => "refresh",
Restore => "restore",
Analyze => "analyze",
Compute => "compute",
Statistics => "statistics",
Columns => "columns",
Msck => "msck",
Repair => "repair",
Sync => "sync",
Partitions => "partitions",
History => "history",
Source => "source",
Target => "target",
}