I think you're after batch? https://developers.cloudflare.com/d1/worker-api/d1-database/#batch
Cloudflare Docs
To interact with your D1 database from your Worker, you need to access it through the environment bindings provided to the Worker (env).

D1 is designed for horizontal scale out across multiple, smaller (10 GB) databases, such as per-user, per-tenant or per-entity databases. D1 allows you to build applications with thousands of databases at no extra cost for isolating with multiple databases. D1 pricing is based only on query and storage costs.


Error: D1_ERROR: internal error
CREATE TABLE IF NOT EXISTS articles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
body TEXT,
created_at TEXT DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
){
"name": "test-for-d1",
"compatibility_date": "2025-2-18",
"compatibility_flags": ["nodejs_compat"],
"pages_build_output_dir": ".vercel/output/static",
"d1_databases": [
{
"bindings": "DB",
"database_name": test-d1",
"database_id": "my database id here"
}
]
}Error: D1_ERROR: internal error