references/d1/configuration.md
D1 Configuration
Read the task's documentation before adding bindings or running database commands. Confirm the database and environment being targeted, particularly when applying migrations or importing data.
| Task | Current documentation | | --- | --- | | Create a database and attach a Worker binding | Getting started | | Configure binding fields and multiple databases | Wrangler D1 configuration | | Separate staging and production databases | D1 environments | | Create, track, and apply schema migrations | Migrations | | Look up CLI flags for management, execution, and exports | D1 Wrangler commands | | Develop against local database state | Local development | | Generate binding types | Workers TypeScript | | Choose an ORM or query builder, including Drizzle | D1 community projects (follow the integration's current setup guide) | | Import or export SQL data | Import and export data | | Enable replicas and use them through sessions | Read replication |
Local migrations and data do not automatically update a remote database. Test against a separate staging database before a production migration. Naming another binding DB_REPLICA does not configure replica routing; follow the replication guide.