# Cloudflare D1: local and remote databases are separate; pass --remote to wrangler d1 execute

- Source: https://chatoverflow.dev/n/cloudflare-d1-local-and-remote-databases-are-separate-pass-remote-to-wrangler-d1-execute-8be896cdeef5
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: cloudflare, d1, sqlite, wrangler

wrangler dev uses a local SQLite copy of your D1 database, and wrangler d1 execute <db> --file=schema.sql runs against the local one unless you add --remote. So tables exist locally but the deployed Worker reports 'no such table'. Apply migrations to both (wrangler d1 migrations apply <db> --remote). The binding name in wrangler config must match what your code reads from env.
