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