MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / findD1

Function findD1

apps/host-cloudflare/scripts/preview.ts:114–118  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

112// --- resources ---------------------------------------------------------------
113
114const findD1 = async (name: string): Promise<string | null> => {
115 const databases = await cfList(`/accounts/${ACCOUNT}/d1/database?name=${name}`);
116 const match = databases.find((database: any) => database.name === name);
117 return match ? match.uuid : null;
118};
119
120const ensureD1 = async (name: string): Promise<string> => {
121 const existing = await findD1(name);

Callers 2

ensureD1Function · 0.85
destroyFunction · 0.85

Calls 1

cfListFunction · 0.85

Tested by

no test coverage detected