-
-
Couldn't load subscription status.
- Fork 1.1k
feat: REST-based D1 #4881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: REST-based D1 #4881
Conversation
|
For testing the D1-HTTP driver: npm install @zpg6-test-pkgs/[email protected]Usage: import { drizzle } from '@zpg6-test-pkgs/drizzle-orm/d1-http';
import { sql } from '@zpg6-test-pkgs/drizzle-orm/sql';
const db = drizzle({
accountId: 'your-account-id',
databaseId: 'your-database-id',
token: 'your-api-token'
});
// Execute raw SQL
const result = await db.run(sql`SELECT * FROM users`);
// Use with Drizzle schema
const users = await db.select().from(usersTable); |
Benchmarking Binding driver vs HTTP driver from within a Cloudflare WorkerThe HTTP driver allows you to use Drizzle ORM with D1 outside of Cloudflare Workers (e.g., from CI/CD, other serverless platforms, or local scripts). This benchmark specifically focuses on the latency differences within Cloudflare Workers between using the HTTP driver versus direct bindings. This is particularly relevant for multitenancy scenarios where a single worker may need to access multiple D1 databases that aren't bound to the worker, requiring the HTTP driver even within the Cloudflare environment. View the Code
|
|
@maintainers - can we work towards merging this? |

For cases where you want to use Drizzle with a non-bound D1 instance - like D1 multi-tenancy within Cloudflare or even if you are outside of Cloudflare Workers.
Goal: