Playground

Scenario

Import a SQLite database

Import opens a .db file from your computer as this tab's app.db, in place of the one the scenario seeded. Your file is read, never written.

Then ask Ptah about it: schema drift compares it with schema.sql, and schema apply --dry-run shows what changing it would take.

A database in WAL mode is refused; checkpoint it first. Reset brings back the seeded database.

The runtime needs JavaScript. Without it this page is still the schema, the file list and the exact commands — they run on your machine instead.

The page below is already yours to read. Only running a command waits for this.

as seeded
-- The schema you want the database to have.
--
-- Ptah reads this file as the desired state, reads the real catalog out of
-- app.db, and works out the difference. You never write ALTER statements here.

CREATE TABLE users (
  id    INTEGER PRIMARY KEY,
  name  TEXT NOT NULL,
  email TEXT NOT NULL
);

CREATE TABLE tasks (
  id      INTEGER PRIMARY KEY,
  user_id INTEGER NOT NULL,
  title   TEXT NOT NULL,
  done    INTEGER NOT NULL DEFAULT 0,
  FOREIGN KEY (user_id) REFERENCES users (id)
);
SQL · desired state not written yet
sqlite://app.db

Nothing has been read out of SQLite yet.

This pane only ever shows rows and columns the database actually returned, after a command finished. The list on the left is what the seed will create; it is marked from the seed until the catalog has been read back.

Start by asking whether the file and the database agree. The workspace has a schema file and a SQLite database with rows already in it. Drift compares the two and tells you, with an exit code, whether they match.
$ ptah schema drift --schema-file schema.sql --db-url sqlite://app.db
sh/workspace
# Scenario A · users + tasks · synthetic data
# The workspace is seeded once the runtime is up; nothing has run yet.
argv only · no pipes, redirects or $(…) · ↑ history · Tab completes

Ptah — · commit — · browser profile SQLite/WASM runtime not started

runtime not started memory-only
Install Ptah CLI

About this playground

Edit a schema, run real Ptah commands against SQLite or PostgreSQL in this tab, inspect the result. Nothing is installed and nothing leaves the browser.

Running
Nothing yet. The build, its commit and the selected database version appear here once the module in this tab has answered for itself.
Cannot
Reach a network database, run Docker, or touch your disk. SQLite and PostgreSQL (PGlite) run in memory. There is no MySQL or MariaDB here. PGlite has one SQL session, so the versioned migrations scenario requires SQLite.
Keeps
Browser preferences. The workspace and database live only in this tab: reloading discards them. Export takes a copy with you.

Cookies and browser storage

This playground does not set cookies or use analytics or advertising trackers.

Saved preferences

Stored in this browser's localStorage until you clear this site's browser data.

Theme
Remembers light or dark mode.ptah-theme
Tour
Remembers that the tour has been shown.ptah-play-tour
Database
Remembers your selected engine. An engine parameter in a link takes priority.ptah-play-engine
Pane sizes
Remembers the widths and heights you set by dragging pane dividers.ptah-playground-panes
Terminal position
Remembers whether the terminal spans the window or sits under the editor.ptah-playground-dock

Temporary session data

A sessionStorage entry prevents repeated reloads when cached files belong to different builds. It is cleared after a successful startup or when the tab closes.

ptah-playground:reloaded-for-stale-cache

These entries contain no SQL, schema files, database rows, or credentials. The playground does not send them to a server.