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

Function runIterator

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

Source from the content-addressed store, hash-verified

225
226 const makeConnection = Effect.gen(function*() {
227 function* runIterator(
228 sql: string,
229 params: ReadonlyArray<unknown> = []
230 ) {
231 const cursor = sqlStorage.exec(sql, ...params)
232 const columns = cursor.columnNames
233 for (const result of cursor.raw()) {
234 const obj: any = {}
235 for (let i = 0; i < columns.length; i++) {
236 const value = result[i]
237 Rec.assignProperty(obj, columns[i], value instanceof ArrayBuffer ? new Uint8Array(value) : value)
238 }
239 yield obj
240 }
241 }
242
243 const runStatement = (
244 sql: string,

Callers 2

runStatementFunction · 0.85
executeStreamFunction · 0.85

Calls 2

execMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected