* Run an introspection query and return all rows. Integers come back as plain * numbers (no `setReadBigInts`), which is what the schema-reading callers need * for boolean flag comparisons. node:sqlite types `.all()` as a generic record * array, so the result is cast to the caller's expected
(sql: string, ...params: any[])
| 150 | * array, so the result is cast to the caller's expected row shape. |
| 151 | */ |
| 152 | private queryAll<T>(sql: string, ...params: any[]): T[] { |
| 153 | if (!this.db) { |
| 154 | throw new Error("Not connected to SQLite database"); |
| 155 | } |
| 156 | return this.db.prepare(sql).all(...params) as unknown as T[]; |
| 157 | } |
| 158 | |
| 159 | /** Run an introspection query and return a single row (or undefined). */ |
| 160 | private queryOne<T>(sql: string, ...params: any[]): T | undefined { |
no test coverage detected