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

Function isMissingFingerprintTable

apps/host-cloudflare/src/db/d1.ts:28–37  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

26};
27
28const isMissingFingerprintTable = (error: unknown): boolean => {
29 for (let current = error, depth = 0; current != null && depth < 8; depth += 1) {
30 const record =
31 typeof current === "object" ? (current as { message?: unknown; cause?: unknown }) : null;
32 const message = typeof record?.message === "string" ? record.message : String(current);
33 if (/no such table/i.test(message) && message.includes(SCHEMA_FINGERPRINT_TABLE)) return true;
34 current = record?.cause ?? null;
35 }
36 return false;
37};
38
39const readPreparedSchemaFingerprint = async (db: D1Database): Promise<string | null> => {
40 const session = db.withSession("first-primary");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected