Skip to content

Add support for SWITCH COLD STORAGE role and status commands - #32

Merged
RaphDal merged 1 commit into
masterfrom
rd_cold_storage_switch
Aug 26, 2026
Merged

Add support for SWITCH COLD STORAGE role and status commands#32
RaphDal merged 1 commit into
masterfrom
rd_cold_storage_switch

Conversation

@RaphDal

@RaphDal RaphDal commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds parser, AST, serialization, syntax-highlighting, and autocomplete support for the cold-storage role-switch commands introduced by questdb/questdb-enterprise#989.

SWITCH COLD STORAGE ROLE TO MANAGER;
SWITCH COLD STORAGE ROLE TO MANAGER FORCE TIMEOUT 10000;
SWITCH COLD STORAGE ROLE TO REFRESHER TIMEOUT 30000;
SWITCH COLD STORAGE STATUS;

Changes

  • Registers COLD, FORCE, MANAGER, and REFRESHER in the public keyword grammar and lexer. They remain non-reserved, matching QuestDB behavior, so they can still be used as unquoted identifiers.
  • Extends SWITCH parsing with:
    • SWITCH COLD STORAGE ROLE TO MANAGER [FORCE] [TIMEOUT <ms>]
    • SWITCH COLD STORAGE ROLE TO REFRESHER [TIMEOUT <ms>]
    • SWITCH COLD STORAGE STATUS
  • Keeps FORCE manager-only in the grammar and autocomplete suggestions.
  • Extends SwitchStatement with cold-storage role/status actions, MANAGER/REFRESHER roles, and the optional force flag.
  • Preserves the new commands through parseToAst()toSql() round trips and regenerates the CST declarations.
  • Adds context-aware autocomplete for every step of the command, including FORCE and TIMEOUT placement.

Testing

  • Lexer coverage for all new keywords.
  • Parse and AST coverage for manager, forced manager, refresher, status, timeout, and mixed-case forms.
  • Regression coverage proving the new non-reserved keywords remain valid identifiers.
  • Round-trip coverage for every supported command shape.
  • Autocomplete walkthrough coverage, including rejecting FORCE after REFRESHER.
  • yarn test — 7000 passed (9 files)
  • yarn typecheck — clean
  • yarn lint — clean
  • yarn build — ESM and CJS builds clean

@RaphDal
RaphDal merged commit 22fee98 into master Aug 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants