web app makes all kinds of D1 requests on a worker request, get session, get user, update user etc.
web app makes all kinds of D1 requests on a worker request, get session, get user, update user etc. Each SQL stmt is a round trip.
If you are building a native application in JavaScript (using Electron for instance), or are working in node.js, you will likely prefer to use a native binding of SQLite to JavaScript.They recommend against that actually



import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
export default defineWorkersConfig({
test: {
globals: true,
poolOptions: {
workers: {
isolatedStorage: true,
wrangler: { configPath: "./wrangler.toml" },
},
},
},
});import { Hono } from 'hono'
export type Env = {
DB: D1Database
}
const app = new Hono<{ Bindings: Env}>()
app.get('/', async (c) => {
console.log(c.env.DB)
return c.text("Hello world!")
})
export default app