Function
parseSqlArgs
(raw: string | undefined)
Source from the content-addressed store, hash-verified
| 24 | } |
| 25 | |
| 26 | function parseSqlArgs(raw: string | undefined): unknown[] { |
| 27 | if (!raw) return []; |
| 28 | try { |
| 29 | const parsed = JSON.parse(raw); |
| 30 | if (Array.isArray(parsed)) return parsed; |
| 31 | } catch { |
| 32 | // Fall through to the shared error below. |
| 33 | } |
| 34 | fail("--args must be a JSON array"); |
| 35 | } |
| 36 | |
| 37 | function convertQuestionMarksToPostgresParams(sql: string): string { |
| 38 | let index = 0; |
Tested by
no test coverage detected