At the moment you cannot create D1 databases dynamically within your worker code. You need to create

At the moment you cannot create D1 databases dynamically within your worker code. You need to create one through the D1 Rest API or the dashboard, and then add it in your wrangler.toml (and/or dynamically patch your worker on the fly).

So, in your case you probably just need to create 5-10 dbs and add them in your wrangler.

There is no automatic migration of the data from your existing DB to those new dbs, just to be clear though.
Was this page helpful?