Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions src/content/partials/workers/wrangler-commands/d1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{}
---

import {Render, AnchorHeading, Type, MetaInfo } from "~/components";
import { Render, AnchorHeading, Type, MetaInfo } from "~/components";

<AnchorHeading title="`create`" slug="d1-create" depth={3} />

Expand Down Expand Up @@ -100,9 +100,11 @@ wrangler d1 export <DATABASE_NAME> [OPTIONS]

- `DATABASE_NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the D1 database to export.
- `--local` <Type text="boolean" /> <MetaInfo text="(default: true) optional" />
- Export from a local database for use with [wrangler dev](#dev).
- `--remote` <Type text="boolean" /> <MetaInfo text="(default: false) optional" />
- Execute commands/files against a remote D1 database for use with [wrangler dev --remote](#dev).
- `--output` <Type text="string" /> <MetaInfo text="optional" />
- Export from a remote D1 database for use with [wrangler dev --remote](#dev).
- `--output` <Type text="string" /> <MetaInfo text="required" />
- Path to the SQL file for your export.
- `--table` <Type text="string" /> <MetaInfo text="optional" />
- The name of the table within a D1 database to export.
Expand All @@ -111,7 +113,11 @@ wrangler d1 export <DATABASE_NAME> [OPTIONS]
- `--no-schema` <Type text="boolean" /> <MetaInfo text="(default: false) optional" />
- Controls whether export SQL file contains database schema. Note that `--no-schema=true` is not recommended due to a known wrangler limitation that intreprets the value as false.

<AnchorHeading title="`time-travel restore`" slug="d1-time-travel-restore" depth={3} />
<AnchorHeading
title="`time-travel restore`"
slug="d1-time-travel-restore"
depth={3}
/>

Restore a database to a specific point-in-time using [Time Travel](/d1/reference/time-travel/).

Expand All @@ -128,7 +134,11 @@ wrangler d1 time-travel restore <DATABASE_NAME> [OPTIONS]
- `--json` <Type text="boolean" /> <MetaInfo text="optional" />
- Return output as JSON rather than a table.

<AnchorHeading title="`time-travel info`" slug="d1-time-travel-info" depth={3} />
<AnchorHeading
title="`time-travel info`"
slug="d1-time-travel-info"
depth={3}
/>

Inspect the current state of a database for a specific point-in-time using [Time Travel](/d1/reference/time-travel/).

Expand Down Expand Up @@ -221,7 +231,11 @@ wrangler d1 backup download <DATABASE_NAME> <BACKUP_ID>
- `--output` <Type text="string" /> <MetaInfo text="optional" />
- The `.sqlite3` file to write to (defaults to `'<DB_NAME>.<SHORT_BACKUP_ID>.sqlite3'`).

<AnchorHeading title="`migrations create`" slug="d1-migrations-create" depth={3} />
<AnchorHeading
title="`migrations create`"
slug="d1-migrations-create"
depth={3}
/>

Create a new migration.

Expand Down Expand Up @@ -259,7 +273,11 @@ wrangler d1 migrations list <DATABASE_NAME> [OPTIONS]
- `--preview` <Type text="boolean" /> <MetaInfo text="optional" />
- Show the list of unapplied migration files on your preview D1 database (as defined by `preview_database_id` in [`wrangler.toml`](/workers/wrangler/configuration/#d1-databases)).

<AnchorHeading title="`migrations apply`" slug="d1-migrations-apply" depth={3} />
<AnchorHeading
title="`migrations apply`"
slug="d1-migrations-apply"
depth={3}
/>

Apply any unapplied migrations.

Expand Down
Loading