Cloudflare D1

Browse and edit remote D1 databases through the Cloudflare API, or open the local copy wrangler uses during development.

Create an API token

  1. In the Cloudflare dashboard, open My Profile › API Tokens and create a custom token.
  2. Give it the D1 Edit permission for your account. Add Account Settings Read if you want Gadwal to find your account ID for you; without it you paste the account ID yourself.
  3. Copy the token. Gadwal keeps it in your Keychain.

Add a remote D1 database

  1. Create a new connection and choose Cloudflare D1.
  2. Paste the token, and the account ID if asked. Gadwal lists the account’s D1 databases.
  3. Pick one. You can now browse tables, edit rows (by primary key or rowid) and run SQL.

D1 has no read-only session. For AI apps on a Read-only D1 connection, Gadwal’s statement classifier is the only guard, and the app says so. Use “Ask before write” if you want every AI change reviewed.

Local development databases

wrangler dev keeps a local copy of each D1 database as an SQLite file under .wrangler/state/v3/d1/ in your project. Choose the local mode for D1, or open the file as an SQLite connection, and pick the file in the Open panel. Gadwal can only read files you pick, because it’s sandboxed.

Backups

Back Up Now works on D1 like on the other engines (all except BigQuery): Gadwal reads each table through the Cloudflare API and saves its structure and rows as compressed SQL in your backup folder. Restore replays that SQL through the same API. See Backups.