Skip to content

feat: MODIFY STRUCTURE / ALTER TABLE — alter an existing table (#6) - #16

Merged
DDecoene merged 13 commits into
mainfrom
feat/modify-structure
Jun 24, 2026
Merged

feat: MODIFY STRUCTURE / ALTER TABLE — alter an existing table (#6)#16
DDecoene merged 13 commits into
mainfrom
feat/modify-structure

Conversation

@DDecoene

Copy link
Copy Markdown
Owner

Summary

Implements issue #6 — alter an existing table's columns without DROP+CREATE (and the data loss that entails).

  • Command family (scriptable, usable from .prg):
    • ALTER TABLE <t> ADD <col> <type>
    • ALTER TABLE <t> DROP <col>
    • ALTER TABLE <t> RENAME <old> TO <new>
    • ALTER TABLE <t> ALTER <col> <type> (type change via rename→create→insert(CAST)→drop)
  • MODIFY STRUCTURE opens an Assistant wizard (diff editor) for the table in USE; also reachable via the new sidebar "Modify structure…" action. Both paths funnel through the server (MODIFY_STRUCTURE action → modstruct-open WS message) so the wizard always gets authoritative column data.
  • ADD/DROP/RENAME use native SQLite column ops; column ops that can invalidate an index drop the table's indexes (SQLite + metadata) and warn to rebuild with INDEX ON.

Version bumped to 0.7.0; CHANGELOG, README, and CLAUDE.md updated (roadmap item marked done).

Test Plan

  • npm test — 188 vitest tests pass (new tests/AlterTable.test.ts: parser, ADD/DROP/RENAME/type-change round-trips, index-drop warnings, error cases, modstruct-open emission)
  • npx playwright test tests/assistant.spec.ts — 10/10 pass (new wizard round-trip E2E)
  • npm run build — typecheck clean

@DDecoene
DDecoene merged commit 4c31536 into main Jun 24, 2026
1 check passed
@DDecoene
DDecoene deleted the feat/modify-structure branch June 24, 2026 20:32
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.

1 participant