(
sql: string,
params: ReadonlyArray<unknown> = []
)
| 78 | const db = options.db |
| 79 | |
| 80 | function* runIterator( |
| 81 | sql: string, |
| 82 | params: ReadonlyArray<unknown> = [] |
| 83 | ) { |
| 84 | const cursor = db.exec(sql, ...params) |
| 85 | const columns = cursor.columnNames |
| 86 | for (const result of cursor.raw()) { |
| 87 | const obj: any = {} |
| 88 | for (let i = 0; i < columns.length; i++) { |
| 89 | const value = result[i] |
| 90 | obj[columns[i]] = value instanceof ArrayBuffer ? new Uint8Array(value) : value |
| 91 | } |
| 92 | yield obj |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | const runStatement = ( |
| 97 | sql: string, |
no test coverage detected