(url: string)
| 40 | } |
| 41 | |
| 42 | function databaseLabel(url: string): string { |
| 43 | if (url.startsWith("file:")) return url.slice(5); |
| 44 | try { |
| 45 | const parsed = new URL(url); |
| 46 | const auth = parsed.username ? `${parsed.username}:***@` : ""; |
| 47 | return `${parsed.protocol}//${auth}${parsed.host}${parsed.pathname}`; |
| 48 | } catch { |
| 49 | return url.replace(/:\/\/([^:@\s]+):([^@\s]+)@/, "://$1:***@"); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Execute a PRAGMA query and return the rows as plain objects. |
no outgoing calls
no test coverage detected