Core tests / core (push) Successful in 9m57s
Full verification / application (push) Failing after 5m16s
Full verification / local-brain (push) Failing after 6m15s
Realm simulation / simulated-live-world (push) Failing after 5m32s
WoW integration lab / real-worldserver (push) Canceled after 17m23s
Source branch: feature/ai-brain-router Source commit: c2a09e0460465201a58aaab56c71424e9a96405e
14 lines
423 B
TypeScript
14 lines
423 B
TypeScript
import { env } from "cloudflare:workers";
|
|
import { drizzle } from "drizzle-orm/d1";
|
|
import * as schema from "./schema";
|
|
|
|
export function getDb() {
|
|
if (!env.DB) {
|
|
throw new Error(
|
|
"Cloudflare D1 binding `DB` is unavailable. Set the `d1` field in .openai/hosting.json to `DB` or let your control plane inject the real binding values before using the database."
|
|
);
|
|
}
|
|
|
|
return drizzle(env.DB, { schema });
|
|
}
|