Skip to content

Feature Request: First-class support for multiple D1 databases #746

Open

Description

@aulikhin

Hello! It would be great to have better support for multiple Cloudflare D1 databases in Void.

According to [Cloudflare's documentation](https://developers.cloudflare.com/d1/platform/limits/), D1 is designed to scale horizontally across multiple smaller databases. Sharding and splitting data across databases help work around limitations such as the 10 GB database size limit and single-threaded query execution.

Void already supports connecting to additional D1 databases through createDb(), but schema management and migrations seem to be built around a single database.

It would be nice to define multiple databases in void.config.ts, each with its own schema and migrations:

export default defineConfig({
  databases: {
    app: {
      binding: 'DB',
      schema: './db/app/schema.ts',
      migrationsDir: './db/app/migrations',
    },
    catalog: {
      binding: 'CATALOG_DB',
      schema: './db/catalog/schema.ts',
      migrationsDir: './db/catalog/migrations',
    },
  },
});

The CLI could then support selecting a specific database:

void db generate --database catalog
void db migrate --database catalog
void db push --database catalog

Ideally, this would also include properly typed Drizzle clients for each database and an easy way to apply the same migrations across multiple databases when sharding.

Of course, existing single-database projects should continue working without any changes.

Since using multiple databases is part of Cloudflare's recommended scaling approach for D1, I think having first-class support for it would be a great addition to Void.

Would this be something you'd consider supporting?

Activity

  1. yangshun commented on Nov 8, 2026

    @yangshun
    Collaborator

    Fully agree, I have wanted this since the beginning. Also we shouldn't stop at just supporting multiple databases, we should also consider supporting multiple instances of all the Void CF bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions