Environments & Synchronization

D1 Studio currently supports a single database configuration from your Wrangler file. While you can configure your project with one database, we’re working on multi-database support for future releases.

Pulling Remote Changes

When you pull remote changes, D1 Studio performs the following steps:

  • Retrieve the Latest Remote State: D1 Studio connects to your Cloudflare D1 database and fetches the current structure and migration history.
  • Preview Updates: The system compares the remote state with your local environment and provides a preview of what will be updated.
  • Update Locally: Once you confirm the preview, your local setup is refreshed to match the remote database.

This process ensures that your local development environment stays in sync with any changes made remotely.

Pushing Local Changes

When you push your local changes, D1 Studio follows these steps:

  • Scan Local Migrations: The tool reviews your local migration files to identify any new changes.
  • Preview the Update: It then compares these changes against what is already applied on the remote database and presents you with a preview.
  • Update Remotely: Once you approve the preview, the new migrations are applied to update your remote database accordingly.

This approach guarantees that your remote database accurately reflects the latest changes from your local development work.

What’s Coming Next

We are actively developing support for multiple database configurations. In upcoming releases, you’ll be able to select which database to work with directly from your Wrangler file. This new feature will provide even more flexibility and control over your environments.