(db: Database | null | undefined)
| 15 | * doesn't care whether the close succeeded. |
| 16 | */ |
| 17 | export function closeQuietly(db: Database | null | undefined): void { |
| 18 | if (!db) return; |
| 19 | // Just attempt close and swallow errors. bun:sqlite has no `open` property, |
| 20 | // and node:sqlite throws on an already-closed handle — both are handled by |
| 21 | // the bare try/catch. |
| 22 | try { |
| 23 | db.close(); |
| 24 | } catch { |
| 25 | // intentional: caller wants quiet close |
| 26 | } |
| 27 | } |