MCPcopy
hub / github.com/CapSoftware/Cap / createDrizzle

Function createDrizzle

packages/database/index.ts:6–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { drizzle } from "drizzle-orm/mysql2";
5
6function createDrizzle() {
7 const url = process.env.DATABASE_URL;
8 if (!url) throw new Error("DATABASE_URL not found");
9
10 if (!url.startsWith("mysql://"))
11 throw new Error("DATABASE_URL is not a MySQL URL");
12
13 return drizzle(url);
14}
15
16let _cached: ReturnType<typeof createDrizzle> | undefined;
17

Callers 1

dbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected