MCPcopy Create free account
hub / github.com/Effect-TS/effect / runIterator

Function runIterator

packages/sql-sqlite-do/src/SqliteClient.ts:86–100  ·  view source on GitHub ↗
(
        sql: string,
        params: ReadonlyArray<unknown> = []
      )

Source from the content-addressed store, hash-verified

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,

Callers 2

runStatementFunction · 0.85
executeStreamFunction · 0.85

Calls 2

execMethod · 0.80
rawMethod · 0.45

Tested by

no test coverage detected