Skip to content

A Big Update to the Ptah Playground

The real Ptah CLI in your browser tab, against SQLite. What's new: guided steps, change marks in the editor, and a layout for phones.

Today we shipped a big update to play.ptah.run.

The playground in a 1280 by 800 window. Across the top: the scenario “Change
a schema, keep the data” and five steps, the first three ticked. Under them, a
strip with the next command, schema apply, and a Run next button. Below it, from
left to right: the workspace files and the tables read back from app.db, the
schema.sql editor with lines 9 and 10 marked, and a Plan pane holding two
statements. The terminal under the editor shows the dry run that produced
them.

The playground is the place to try Ptah without installing anything. It runs the real Ptah CLI, version 0.8.0, compiled to WebAssembly, against a SQLite database that lives in your browser tab. The plans, the output and the exit codes are Ptah’s own, not a recording.

You pick a scenario, follow its steps, and watch the schema, the database and the terminal change as you go.

Each step tells you what to do, and now it can make the edit for you too. When a step changes the schema, Apply patch writes the edit into schema.sql. Cmd+Z or Ctrl+Z undoes it.

The editor marks what changed compared to the original file. Click a mark to see the old lines and revert only that change.

The file list and the schema.sql editor after Apply patch. Line 9 is marked
as changed and line 10, “active INTEGER NOT NULL DEFAULT 1”, as added. A
popover under them reads “Lines 9–10 changed”, shows the old line and the new
ones, and offers “Revert this change”. In the file list, the active column is
marked “not applied yet”.

A step gets its tick when the database is in the state the step asks for, not when you press a button.

When Ptah asks you to confirm a change, the page points you to the prompt. It never types YES for you.

The playground while schema apply waits for an answer. The strip reads
“Ptah is waiting for your answer in the terminal.” next to the question “Apply
these schema changes? Type ‘YES’ to confirm:”. At the foot of the terminal,
the prompt row is highlighted in amber.

The scenario picker over the dimmed playground, listing “Change a schema,
keep the data”, “Detect drift”, “Versioned migrations” and “Free
exploration”.

Change a schema and keep the data, catch drift, write versioned migrations, or explore on your own with no steps at all. Import opens a SQLite file from your computer, and Export downloads your workspace to continue with the installed CLI.

On a narrow screen, the panes turn into tabs at the bottom. The editor can go full screen, with a Save button.

Three phone screens side by side: the console after schema drift, the
schema.sql editor in full screen with the changed lines marked, and the
Database tab showing the users rows after the apply.

  • Drag the lines between the panes to resize them.
  • Your work lives only in this tab, so a link that leaves the playground asks first.
  • In the editor, Tab indents. Press Escape and then Tab to move out of it.

The first scenario adds a column to a table that already has three rows. After the edit, Ptah shows what it would run:

examples/measured/a3-dry-run.txt
$ ptah schema apply --schema-file schema.sql --db-url sqlite://app.db --dry-run
Planned schema changes:
ALTER TABLE "users" ADD COLUMN "active" INTEGER NOT NULL DEFAULT 1;
CREATE INDEX IF NOT EXISTS "idx_users_email" ON "users" ("email");

You type YES, Ptah applies it, and the rows are still there, with the new column filled from its default:

schema.sql on the left, with the active column in the users table. On the
right, the Data pane for users after the apply: Ada, Grace and Alan each have
active set to 1, the new column is marked “new”, and a note says the table
still has 3 rows.

The drift scenario shows the opposite case. Someone changes the database directly, and Ptah reports it with exit code 1:

examples/measured/b3-drift.txt
$ ptah schema drift --schema-file schema.sql --db-url sqlite://app.db
Schema drift detected (highest severity: destructive).
Failure threshold: all. Failing: true.
Database: sqlite://app.db
Findings:
- columns_removed: 1 (destructive)

The new column shows up as “removed” because that is what it would take to make the database match the file again.

  • SQLite only. The tab can’t reach PostgreSQL, MySQL or the other databases Ptah supports.
  • Nothing is saved. Reload the page and your work is gone, so export it first.
  • The terminal runs one command at a time: no pipes or redirects.
  • The first visit downloads about 24 MB.

Give it a try at play.ptah.run. The site’s source is on GitHub at stokaro/ptah-sandbox. The output in this post was captured on September 23, 2026; the example files have all of it.

Example files