This was changed a while ago in how the data was stored. You should be using miniflare to interact w
This was changed a while ago in how the data was stored. You should be using miniflare to interact with your bindings locally


https://<worker-host-name>/cdn-cgi/trace i.e https://cloudflare.com/cdn-cgi/trace and look at colo= for the airport code of where the worker is runninghttps://<worker-host-name>/cdn-cgi/tracehttps://cloudflare.com/cdn-cgi/traceimport { drizzle } from "drizzle-orm/better-sqlite3";
import Database from "better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
const sqlite = new Database(
"../.wrangler/state/v3/d1/miniflare-D1DatabaseObject/8c4adb7a51078a272a8336d1d6f606acb37a5564b94ce38b4862ef2734d493a1.sqlite"
);
const db = drizzle(sqlite);
migrate(db, { migrationsFolder: "drizzle" });
sqlite.close();import { Hono } from "hono";
const app = new Hono<{
Bindings: {
DB: D1Database;
};
}>();
app.get("/", async (c) => {
const result = c.env.DB.prepare(`
select * from users where id = 420;
`);
const t = performance.now();
await result.first();
return c.text(`Query took ${performance.now() - t}ms`);
});
export default app;