Skip to content

feat(sql-editor): schema history sample for table v1…vN - #250

Draft
huyplb wants to merge 1 commit into
mainfrom
cursor/history-table-sample-847b
Draft

feat(sql-editor): schema history sample for table v1…vN#250
huyplb wants to merge 1 commit into
mainfrom
cursor/history-table-sample-847b

Conversation

@huyplb

@huyplb huyplb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Why

A bookmark you can run tomorrow to exercise History: table growth v1…vN, column mutations, and Revert.

Sample

SQL Editor → Bookmarks → Add samples (or Refresh samples) → ★ Sample · Schema history (table v1…vN)

Works on SQLite, Postgres, or MySQL. Safe mode OFF.

How to test

  1. Add a SQLite file credential (or use Postgres). Check it as a destination.
  2. Open the sample. Play the JS playbook cell first — it lists the steps.
  3. Play CREATE TABLE only (strip ▶), then Compare Schema → Snapshot target.
  4. Play ADD email and CREATE INDEX, Snapshot again.
  5. Play ADD phone and CREATE VIEW, Snapshot again.
  6. History → confirm Tables / Views / Functions / Procedures + Changes only.
  7. Click fox_hist_customers:
    • Columns at the selected version
    • Growth v1…v3 (2 cols → 3 cols, then an index + view in the graph)
    • Change timeline: email ADD, phone ADD
    • Click v1 to see the initial columns; Revert on v1 plans dropping email/phone (lossy — confirm before apply)

Cleanup cells (DROP VIEW / DROP TABLE) reset the demo so you can start over.

Tests

sqlEditorSamples.test.ts — unique id, splits into a playbook JS cell plus per-version SQL, last=null still ok.

Open in Web Open in Cursor 

Bookmark walkthrough: CREATE TABLE, ADD email + index, ADD phone + view,
with a playbook cell that says to Snapshot after each step and inspect
fox_hist_customers in History (growth, column mutations, Revert).

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
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