Skip to content

Commit 9e93a49

Browse files
Document import d1 in the embedded agent guide.
Covers the doctor/lint/start/verify/complete sequence, migration ID resumability, and that start does not prompt in JSON mode so agents must dry-run and get approval first. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6091962 commit 9e93a49

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,23 @@ Error: one JSON object on stdout with `status: "error"`, `error`, and `next_step
157157

158158
Destructive SQL without `--force`: `status: "action_required"`, `query_kind: "destructive"`, `issues`, and `next_steps` (includes `--force` retry command).
159159

160+
## Imports (Cloudflare D1)
161+
162+
`pscale import d1` migrates a Cloudflare D1 (SQLite) export into a PlanetScale Postgres branch. Every subcommand supports `--format json` and returns `status`, `issues`, and `next_steps`; stateful steps return a `migration_id` — pass it back with `--migration-id` to resume.
163+
164+
```bash
165+
pscale import d1 doctor --format json # check prerequisites (pgloader, psql)
166+
pscale import d1 lint --input <file> --format json # pre-import checks; errors block import
167+
pscale import d1 start <database> --org <org> --input <file> --dry-run --format json # plan + migration ID, no writes
168+
pscale import d1 start <database> --org <org> --input <file> --format json # run the import
169+
pscale import d1 verify <database> --org <org> --migration-id <id> --sqlite <file> --format json
170+
pscale import d1 complete <database> --org <org> --migration-id <id> --format json
171+
```
172+
173+
Branch is an optional second positional (defaults to the default branch). `status --migration-id <id>` shows saved migration state; `convert-schema --input <file>` converts schema only.
174+
175+
**`start` in JSON mode does not prompt.** The confirmation prompt is human-format only; with `--format json`, `start` loads data immediately. Run `start --dry-run` first, show the user the plan, and only run the real `start` after they approve.
176+
160177
## API passthrough
161178

162179
```bash

0 commit comments

Comments
 (0)