Skip to main content

vibesql_parser/
keywords.rs

1use std::fmt;
2
3/// SQL Keywords supported by the parser.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum Keyword {
6    Select,
7    Distinct,
8    From,
9    Where,
10    Insert,
11    Into,
12    Replace,
13    Ignore,
14    Update,
15    Delete,
16    Duplicate,
17    Create,
18    Table,
19    Truncate,
20    Drop,
21    Alter,
22    And,
23    Or,
24    Not,
25    Null,
26    True,
27    False,
28    Unknown,
29    As,
30    Join,
31    Left,
32    Right,
33    Inner,
34    Outer,
35    Cross,
36    Full,
37    Natural,
38    On,
39    Group,
40    Groups,
41    By,
42    // OLAP extensions for GROUP BY
43    Rollup,
44    Cube,
45    Sets,
46    Grouping,
47    GroupingId,
48    Having,
49    Order,
50    Asc,
51    Desc,
52    Nulls,
53    Limit,
54    Offset,
55    Set,
56    Values,
57    In,
58    Between,
59    Asymmetric,
60    Symmetric,
61    Like,
62    Glob,
63    Escape,
64    Exists,
65    If,
66    All,
67    Any,
68    Some,
69    Union,
70    Intersect,
71    Except,
72    With,
73    Recursive,
74    // CTE materialization hints (SQL:1999)
75    Materialized,
76    Date,
77    Time,
78    Timestamp,
79    Interval,
80    Cast,
81    // CASE expression keywords
82    Case,
83    When,
84    Then,
85    Else,
86    End,
87    // Window function keywords
88    Over,
89    Partition,
90    Rows,
91    Range,
92    Preceding,
93    Following,
94    Unbounded,
95    Current,
96    Filter,
97    Exclude,
98    Others,
99    Ties,
100    Window,
101    // Note: Window function names (ROW_NUMBER, RANK, etc.) are identifiers, not keywords
102    // Constraint keywords
103    Primary,
104    Foreign,
105    Key,
106    Unique,
107    Check,
108    References,
109    // IS NULL keywords
110    Is,
111    // SQLite ISNULL/NOTNULL postfix operators
112    Isnull,
113    Notnull,
114    // Transaction keywords
115    Begin,
116    Commit,
117    Rollback,
118    // SCHEMA keywords
119    Cascade,
120    Restrict,
121    Schema,
122    Start,
123    Transaction,
124    // ALTER TABLE keywords
125    Add,
126    Column,
127    Constraint,
128    Default,
129    Rename,
130    Modify,
131    Change,
132    /// RETURNING clause on DML statements (SQLite 3.35.0+)
133    Returning,
134    // SAVEPOINT keywords
135    Savepoint,
136    Release,
137    To,
138    // Role management keywords
139    Role,
140    // TRIM function keywords
141    Both,
142    Leading,
143    Trailing,
144    // MySQL arithmetic operators
145    Div,
146    // Data type keywords
147    Varying,
148    Characters,
149    Octets,
150    Using,
151    // SUBSTRING function keywords
152    For,
153    // Current date/time function keywords
154    CurrentDate,
155    CurrentTime,
156    CurrentTimestamp,
157    // GRANT keywords
158    Grant,
159    Privileges,
160    Usage,
161    Option,
162    // REVOKE keywords
163    Revoke,
164    Granted,
165    // Advanced privilege keywords
166    Execute,
167    Trigger,
168    Under,
169    // Advanced SQL object keywords
170    Domain,
171    Sequence,
172    Type,
173    Collation,
174    Character,
175    Translation,
176    View,
177    Index,
178    Analyze,
179    Reindex,
180    Vacuum,
181    Explain,
182    Assertion,
183    Specific,
184    // Trigger-specific keywords
185    Before,
186    After,
187    Instead,
188    Of,
189    Each,
190    Row,
191    Statement,
192    Enable,
193    Disable,
194    // SEQUENCE specific keywords
195    Increment,
196    Minvalue,
197    Maxvalue,
198    Cycle,
199    No,
200    Restart,
201    Next,
202    // Referential action keywords
203    Action,
204    // Constraint deferral keywords (SQL:1999)
205    Deferrable,
206    Deferred,
207    Immediate,
208    Initially,
209    // Session configuration keywords (SQL:1999)
210    Catalog,
211    Names,
212    Zone,
213    Local,
214    Session,
215    Global,
216    // Interval unit keywords
217    Year,
218    Quarter,
219    Month,
220    Week,
221    Day,
222    Hour,
223    Minute,
224    Second,
225    Microsecond,
226    // Callable object keywords (functions, procedures, methods)
227    Function,
228    Procedure,
229    Call,
230    Routine,
231    Method,
232    Constructor,
233    Static,
234    Instance,
235    // Procedure/Function parameter modes
236    Out,
237    InOut,
238    // Procedure/Function keywords
239    Returns,
240    While,
241    Do,
242    Loop,
243    Repeat,
244    Until,
245    Return,
246    Leave,
247    Iterate,
248    // Procedure/Function characteristics (Phase 6)
249    Deterministic,
250    Language,
251    Sql,
252    Security,
253    Definer,
254    Invoker,
255    // Internationalization keywords (SQL:1999)
256    Get,
257    Pad,
258    Space,
259    Collate,
260    // Generated column keywords (SQLite)
261    Generated,
262    Always,
263    Stored,
264    Virtual,
265    // CURSOR keywords
266    Declare,
267    Cursor,
268    Insensitive,
269    // Prepared statement keywords
270    Prepare,
271    Deallocate,
272    Scroll,
273    Hold,
274    Without,
275    Read,
276    Only,
277    Oids,
278    Rowid,
279    Open,
280    Fetch,
281    Close,
282    Prior,
283    First,
284    Last,
285    Absolute,
286    Relative,
287    Serializable,
288    Isolation,
289    Level,
290    Write,
291    Comment,
292    // MySQL table option keywords
293    KeyBlockSize,
294    Connection,
295    InsertMethod,
296    RowFormat,
297    DelayKeyWrite,
298    TableChecksum,
299    Checksum,
300    StatsSamplePages,
301    Password,
302    AvgRowLength,
303    MinRows,
304    MaxRows,
305    SecondaryEngine,
306    // MySQL table option values
307    Dynamic,
308    Fixed,
309    Compressed,
310    Redundant,
311    Compact,
312    // Full-text search keywords
313    Fulltext,
314    Match,
315    Against,
316    Boolean,
317    Expansion,
318    Mode,
319    Query,
320    Plan,
321    // Spatial index keywords
322    Spatial,
323    // Vector index keywords (IVFFlat, HNSW)
324    Ivfflat,
325    Hnsw,
326    Lists,
327    Probes,
328    EfConstruction,
329    EfSearch,
330    M,
331    // Database introspection keywords
332    Show,
333    Describe,
334    Databases,
335    Tables,
336    Columns,
337    Fields,
338    Indexes,
339    Keys,
340    // Auto-increment keywords (MySQL and SQLite)
341    AutoIncrement,
342    // Temporary object keywords (SQLite)
343    Temp,
344    Temporary,
345    // VibeSQL storage format keywords
346    Storage,
347    Columnar,
348    // Transaction durability hint keywords
349    Durability,
350    Lazy,
351    Durable,
352    Volatile,
353    // SQLite compatibility keywords
354    Pragma,
355    // SQLite conflict resolution keywords
356    Abort,
357    Fail,
358    Conflict,
359    Nothing,
360}
361
362impl Keyword {
363    /// Returns true if this keyword can be used as an unquoted column or table name.
364    /// These are "unreserved" keywords that are only treated as keywords in specific contexts.
365    ///
366    /// This follows SQLite's behavior where temporal type keywords (TIMESTAMP, DATE, TIME,
367    /// INTERVAL) and interval unit keywords (YEAR, MONTH, DAY, etc.) can be used as identifiers
368    /// without quoting.
369    ///
370    /// TYPE and SQL are also unreserved to match SQLite compatibility (neither is in SQLite's
371    /// 147-keyword reserved list). They work safely because:
372    /// - TYPE: Parser uses peek_next_keyword() for CREATE TYPE dispatch
373    /// - SQL: Only consumed after explicit LANGUAGE keyword in routines
374    pub fn can_be_identifier(&self) -> bool {
375        matches!(
376            self,
377            // Temporal type keywords
378            Keyword::Timestamp | Keyword::Date | Keyword::Time | Keyword::Interval |
379            // Interval unit keywords (used in EXTRACT, DATE_ADD, etc. but also valid as identifiers)
380            Keyword::Year | Keyword::Quarter | Keyword::Month | Keyword::Week |
381            Keyword::Day | Keyword::Hour | Keyword::Minute | Keyword::Second |
382            Keyword::Microsecond |
383            // SQLite compatibility: TYPE and SQL are not reserved in SQLite
384            // (allows unquoted access to sqlite_master.type and sqlite_master.sql columns)
385            // ROWID is the pseudo-column for implicit row IDs in SQLite tables
386            Keyword::Type | Keyword::Sql | Keyword::Rowid |
387            // Vector index parameter: M is only contextual in HNSW WITH clause
388            // SQLite TCL tests commonly use 'm' as a column name
389            Keyword::M |
390            // NULLS is only contextual in ORDER BY (NULLS FIRST/LAST)
391            // Can be used as identifier for table/column/CTE names
392            Keyword::Nulls |
393            // SQLite schema keywords: TEMP/TEMPORARY are valid schema names
394            // Allows three-part qualified names like temp.t1.column
395            Keyword::Temp | Keyword::Temporary |
396            // Procedure parameter direction keywords: OUT/INOUT are only meaningful
397            // in stored procedure contexts, safe to use as identifiers elsewhere
398            // SQLite TCL tests use 'out' as a CTE name
399            Keyword::Out | Keyword::InOut |
400            // Join keywords: SQLite allows these as identifiers (table/column/function names)
401            // when not in a join context. SQLite TCL tests (func8.test) use these extensively.
402            Keyword::Cross | Keyword::Full | Keyword::Inner | Keyword::Left |
403            Keyword::Natural | Keyword::Outer | Keyword::Right |
404            // Window function keywords: These are contextual in window frame specifications
405            // but can be used as identifiers elsewhere. SQLite TCL tests (window1.test)
406            // create tables with these as column names.
407            Keyword::Current | Keyword::Exclude | Keyword::Filter | Keyword::Following |
408            Keyword::Groups | Keyword::No | Keyword::Others | Keyword::Over |
409            Keyword::Partition | Keyword::Preceding | Keyword::Range | Keyword::Ties |
410            Keyword::Unbounded | Keyword::Window | Keyword::First | Keyword::Last |
411            // RETURNING is a "fallback" keyword in SQLite (3.35.0+): it is only
412            // meaningful at the end of a DML statement and remains usable as an
413            // ordinary identifier elsewhere.
414            Keyword::Returning
415        )
416    }
417}
418
419impl fmt::Display for Keyword {
420    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
421        let keyword_str = match self {
422            Keyword::Select => "SELECT",
423            Keyword::Distinct => "DISTINCT",
424            Keyword::From => "FROM",
425            Keyword::Where => "WHERE",
426            Keyword::Insert => "INSERT",
427            Keyword::Into => "INTO",
428            Keyword::Replace => "REPLACE",
429            Keyword::Ignore => "IGNORE",
430            Keyword::Update => "UPDATE",
431            Keyword::Delete => "DELETE",
432            Keyword::Duplicate => "DUPLICATE",
433            Keyword::Create => "CREATE",
434            Keyword::Table => "TABLE",
435            Keyword::Truncate => "TRUNCATE",
436            Keyword::Drop => "DROP",
437            Keyword::Alter => "ALTER",
438            Keyword::And => "AND",
439            Keyword::Or => "OR",
440            Keyword::Not => "NOT",
441            Keyword::Null => "NULL",
442            Keyword::True => "TRUE",
443            Keyword::False => "FALSE",
444            Keyword::Unknown => "UNKNOWN",
445            Keyword::As => "AS",
446            Keyword::Join => "JOIN",
447            Keyword::Left => "LEFT",
448            Keyword::Right => "RIGHT",
449            Keyword::Inner => "INNER",
450            Keyword::Outer => "OUTER",
451            Keyword::Cross => "CROSS",
452            Keyword::Full => "FULL",
453            Keyword::Natural => "NATURAL",
454            Keyword::On => "ON",
455            Keyword::Group => "GROUP",
456            Keyword::Groups => "GROUPS",
457            Keyword::By => "BY",
458            Keyword::Rollup => "ROLLUP",
459            Keyword::Cube => "CUBE",
460            Keyword::Sets => "SETS",
461            Keyword::Grouping => "GROUPING",
462            Keyword::GroupingId => "GROUPING_ID",
463            Keyword::Having => "HAVING",
464            Keyword::Order => "ORDER",
465            Keyword::Asc => "ASC",
466            Keyword::Desc => "DESC",
467            Keyword::Nulls => "NULLS",
468            Keyword::Limit => "LIMIT",
469            Keyword::Offset => "OFFSET",
470            Keyword::Set => "SET",
471            Keyword::Values => "VALUES",
472            Keyword::In => "IN",
473            Keyword::Between => "BETWEEN",
474            Keyword::Asymmetric => "ASYMMETRIC",
475            Keyword::Symmetric => "SYMMETRIC",
476            Keyword::Like => "LIKE",
477            Keyword::Glob => "GLOB",
478            Keyword::Escape => "ESCAPE",
479            Keyword::Exists => "EXISTS",
480            Keyword::If => "IF",
481            Keyword::All => "ALL",
482            Keyword::Any => "ANY",
483            Keyword::Some => "SOME",
484            Keyword::Union => "UNION",
485            Keyword::Intersect => "INTERSECT",
486            Keyword::Except => "EXCEPT",
487            Keyword::With => "WITH",
488            Keyword::Recursive => "RECURSIVE",
489            Keyword::Materialized => "MATERIALIZED",
490            Keyword::Date => "DATE",
491            Keyword::Time => "TIME",
492            Keyword::Timestamp => "TIMESTAMP",
493            Keyword::Interval => "INTERVAL",
494            Keyword::Cast => "CAST",
495            Keyword::Case => "CASE",
496            Keyword::When => "WHEN",
497            Keyword::Then => "THEN",
498            Keyword::Else => "ELSE",
499            Keyword::End => "END",
500            Keyword::Over => "OVER",
501            Keyword::Partition => "PARTITION",
502            Keyword::Rows => "ROWS",
503            Keyword::Range => "RANGE",
504            Keyword::Preceding => "PRECEDING",
505            Keyword::Following => "FOLLOWING",
506            Keyword::Unbounded => "UNBOUNDED",
507            Keyword::Current => "CURRENT",
508            Keyword::Filter => "FILTER",
509            Keyword::Exclude => "EXCLUDE",
510            Keyword::Others => "OTHERS",
511            Keyword::Ties => "TIES",
512            Keyword::Window => "WINDOW",
513            Keyword::Primary => "PRIMARY",
514            Keyword::Foreign => "FOREIGN",
515            Keyword::Key => "KEY",
516            Keyword::Unique => "UNIQUE",
517            Keyword::Check => "CHECK",
518            Keyword::References => "REFERENCES",
519            Keyword::Is => "IS",
520            Keyword::Isnull => "ISNULL",
521            Keyword::Notnull => "NOTNULL",
522            Keyword::Begin => "BEGIN",
523            Keyword::Commit => "COMMIT",
524            Keyword::Rollback => "ROLLBACK",
525            Keyword::Cascade => "CASCADE",
526            Keyword::Restrict => "RESTRICT",
527            Keyword::Schema => "SCHEMA",
528            Keyword::Start => "START",
529            Keyword::Transaction => "TRANSACTION",
530            Keyword::Add => "ADD",
531            Keyword::Column => "COLUMN",
532            Keyword::Constraint => "CONSTRAINT",
533            Keyword::Default => "DEFAULT",
534            Keyword::Rename => "RENAME",
535            Keyword::Returning => "RETURNING",
536            Keyword::Modify => "MODIFY",
537            Keyword::Change => "CHANGE",
538            Keyword::Savepoint => "SAVEPOINT",
539            Keyword::Release => "RELEASE",
540            Keyword::To => "TO",
541            Keyword::Role => "ROLE",
542            Keyword::Both => "BOTH",
543            Keyword::Leading => "LEADING",
544            Keyword::Trailing => "TRAILING",
545            Keyword::Div => "DIV",
546            Keyword::Varying => "VARYING",
547            Keyword::Characters => "CHARACTERS",
548            Keyword::Octets => "OCTETS",
549            Keyword::Using => "USING",
550            Keyword::For => "FOR",
551            Keyword::CurrentDate => "CURRENT_DATE",
552            Keyword::CurrentTime => "CURRENT_TIME",
553            Keyword::CurrentTimestamp => "CURRENT_TIMESTAMP",
554            Keyword::Grant => "GRANT",
555            Keyword::Privileges => "PRIVILEGES",
556            Keyword::Usage => "USAGE",
557            Keyword::Option => "OPTION",
558            Keyword::Revoke => "REVOKE",
559            Keyword::Granted => "GRANTED",
560            Keyword::Execute => "EXECUTE",
561            Keyword::Trigger => "TRIGGER",
562            Keyword::Under => "UNDER",
563            Keyword::Domain => "DOMAIN",
564            Keyword::Sequence => "SEQUENCE",
565            Keyword::Type => "TYPE",
566            Keyword::Collation => "COLLATION",
567            Keyword::Character => "CHARACTER",
568            Keyword::Translation => "TRANSLATION",
569            Keyword::View => "VIEW",
570            Keyword::Index => "INDEX",
571            Keyword::Analyze => "ANALYZE",
572            Keyword::Reindex => "REINDEX",
573            Keyword::Vacuum => "VACUUM",
574            Keyword::Explain => "EXPLAIN",
575            Keyword::Assertion => "ASSERTION",
576            Keyword::Specific => "SPECIFIC",
577            Keyword::Before => "BEFORE",
578            Keyword::After => "AFTER",
579            Keyword::Instead => "INSTEAD",
580            Keyword::Of => "OF",
581            Keyword::Each => "EACH",
582            Keyword::Row => "ROW",
583            Keyword::Statement => "STATEMENT",
584            Keyword::Enable => "ENABLE",
585            Keyword::Disable => "DISABLE",
586            Keyword::Increment => "INCREMENT",
587            Keyword::Minvalue => "MINVALUE",
588            Keyword::Maxvalue => "MAXVALUE",
589            Keyword::Cycle => "CYCLE",
590            Keyword::No => "NO",
591            Keyword::Restart => "RESTART",
592            Keyword::Next => "NEXT",
593            Keyword::Action => "ACTION",
594            Keyword::Deferrable => "DEFERRABLE",
595            Keyword::Deferred => "DEFERRED",
596            Keyword::Immediate => "IMMEDIATE",
597            Keyword::Initially => "INITIALLY",
598            Keyword::Catalog => "CATALOG",
599            Keyword::Names => "NAMES",
600            Keyword::Zone => "ZONE",
601            Keyword::Local => "LOCAL",
602            Keyword::Session => "SESSION",
603            Keyword::Global => "GLOBAL",
604            Keyword::Year => "YEAR",
605            Keyword::Quarter => "QUARTER",
606            Keyword::Month => "MONTH",
607            Keyword::Week => "WEEK",
608            Keyword::Day => "DAY",
609            Keyword::Hour => "HOUR",
610            Keyword::Minute => "MINUTE",
611            Keyword::Second => "SECOND",
612            Keyword::Microsecond => "MICROSECOND",
613            Keyword::Function => "FUNCTION",
614            Keyword::Procedure => "PROCEDURE",
615            Keyword::Call => "CALL",
616            Keyword::Routine => "ROUTINE",
617            Keyword::Method => "METHOD",
618            Keyword::Constructor => "CONSTRUCTOR",
619            Keyword::Static => "STATIC",
620            Keyword::Instance => "INSTANCE",
621            Keyword::Out => "OUT",
622            Keyword::InOut => "INOUT",
623            Keyword::Returns => "RETURNS",
624            Keyword::While => "WHILE",
625            Keyword::Do => "DO",
626            Keyword::Loop => "LOOP",
627            Keyword::Repeat => "REPEAT",
628            Keyword::Until => "UNTIL",
629            Keyword::Return => "RETURN",
630            Keyword::Leave => "LEAVE",
631            Keyword::Iterate => "ITERATE",
632            Keyword::Deterministic => "DETERMINISTIC",
633            Keyword::Language => "LANGUAGE",
634            Keyword::Sql => "SQL",
635            Keyword::Security => "SECURITY",
636            Keyword::Definer => "DEFINER",
637            Keyword::Invoker => "INVOKER",
638            Keyword::Comment => "COMMENT",
639            Keyword::Get => "GET",
640            Keyword::Pad => "PAD",
641            Keyword::Space => "SPACE",
642            Keyword::Collate => "COLLATE",
643            Keyword::Generated => "GENERATED",
644            Keyword::Always => "ALWAYS",
645            Keyword::Stored => "STORED",
646            Keyword::Virtual => "VIRTUAL",
647            Keyword::Declare => "DECLARE",
648            Keyword::Cursor => "CURSOR",
649            Keyword::Insensitive => "INSENSITIVE",
650            Keyword::Prepare => "PREPARE",
651            Keyword::Deallocate => "DEALLOCATE",
652            Keyword::Scroll => "SCROLL",
653            Keyword::Hold => "HOLD",
654            Keyword::Without => "WITHOUT",
655            Keyword::Read => "READ",
656            Keyword::Only => "ONLY",
657            Keyword::Oids => "OIDS",
658            Keyword::Rowid => "ROWID",
659            Keyword::Open => "OPEN",
660            Keyword::Fetch => "FETCH",
661            Keyword::Close => "CLOSE",
662            Keyword::Prior => "PRIOR",
663            Keyword::First => "FIRST",
664            Keyword::Last => "LAST",
665            Keyword::Absolute => "ABSOLUTE",
666            Keyword::Relative => "RELATIVE",
667            Keyword::Serializable => "SERIALIZABLE",
668            Keyword::Isolation => "ISOLATION",
669            Keyword::Level => "LEVEL",
670            Keyword::Write => "WRITE",
671            // MySQL table option keywords
672            Keyword::KeyBlockSize => "KEY_BLOCK_SIZE",
673            Keyword::Connection => "CONNECTION",
674            Keyword::InsertMethod => "INSERT_METHOD",
675            Keyword::RowFormat => "ROW_FORMAT",
676            Keyword::DelayKeyWrite => "DELAY_KEY_WRITE",
677            Keyword::TableChecksum => "TABLE_CHECKSUM",
678            Keyword::Checksum => "CHECKSUM",
679            Keyword::StatsSamplePages => "STATS_SAMPLE_PAGES",
680            Keyword::Password => "PASSWORD",
681            Keyword::AvgRowLength => "AVG_ROW_LENGTH",
682            Keyword::MinRows => "MIN_ROWS",
683            Keyword::MaxRows => "MAX_ROWS",
684            Keyword::SecondaryEngine => "SECONDARY_ENGINE",
685            // MySQL table option values
686            Keyword::Dynamic => "DYNAMIC",
687            Keyword::Fixed => "FIXED",
688            Keyword::Compressed => "COMPRESSED",
689            Keyword::Redundant => "REDUNDANT",
690            Keyword::Compact => "COMPACT",
691            // Full-text search keywords
692            Keyword::Fulltext => "FULLTEXT",
693            Keyword::Match => "MATCH",
694            Keyword::Against => "AGAINST",
695            Keyword::Boolean => "BOOLEAN",
696            Keyword::Expansion => "EXPANSION",
697            Keyword::Mode => "MODE",
698            Keyword::Query => "QUERY",
699            Keyword::Plan => "PLAN",
700            // Spatial index keywords
701            Keyword::Spatial => "SPATIAL",
702            // Vector index keywords (IVFFlat, HNSW)
703            Keyword::Ivfflat => "IVFFLAT",
704            Keyword::Hnsw => "HNSW",
705            Keyword::Lists => "LISTS",
706            Keyword::Probes => "PROBES",
707            Keyword::EfConstruction => "EF_CONSTRUCTION",
708            Keyword::EfSearch => "EF_SEARCH",
709            Keyword::M => "M",
710            // Database introspection keywords
711            Keyword::Show => "SHOW",
712            Keyword::Describe => "DESCRIBE",
713            Keyword::Databases => "DATABASES",
714            Keyword::Tables => "TABLES",
715            Keyword::Columns => "COLUMNS",
716            Keyword::Fields => "FIELDS",
717            Keyword::Indexes => "INDEXES",
718            Keyword::Keys => "KEYS",
719            // Auto-increment keywords
720            Keyword::AutoIncrement => "AUTO_INCREMENT",
721            // Temporary object keywords
722            Keyword::Temp => "TEMP",
723            Keyword::Temporary => "TEMPORARY",
724            // VibeSQL storage format keywords
725            Keyword::Storage => "STORAGE",
726            Keyword::Columnar => "COLUMNAR",
727            // Transaction durability hint keywords
728            Keyword::Durability => "DURABILITY",
729            Keyword::Lazy => "LAZY",
730            Keyword::Durable => "DURABLE",
731            Keyword::Volatile => "VOLATILE",
732            // SQLite compatibility keywords
733            Keyword::Pragma => "PRAGMA",
734            // SQLite conflict resolution keywords
735            Keyword::Abort => "ABORT",
736            Keyword::Fail => "FAIL",
737            Keyword::Conflict => "CONFLICT",
738            Keyword::Nothing => "NOTHING",
739        };
740        write!(f, "{}", keyword_str)
741    }
742}