(error: unknown)
| 26 | }; |
| 27 | |
| 28 | const 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 | |
| 39 | const readPreparedSchemaFingerprint = async (db: D1Database): Promise<string | null> => { |
| 40 | const session = db.withSession("first-primary"); |
no outgoing calls
no test coverage detected