MCPcopy Create free account
hub / github.com/effect-app/libs / runIterator

Function runIterator

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

Source from the content-addressed store, hash-verified

190 const sqlStorage = db
191
192 const makeConnection = Effect.gen(function*() {
193 function* runIterator(
194 sql: string,
195 params: ReadonlyArray<unknown> = []
196 ) {
197 const cursor = sqlStorage.exec(sql, ...params)
198 const columns = cursor.columnNames
199 for (const result of cursor.raw()) {
200 const obj: any = {}
201 for (let i = 0; i < columns.length; i++) {
202 const value = result[i]
203 Rec.assignProperty(obj, columns[i], value instanceof ArrayBuffer ? new Uint8Array(value) : value)
204 }
205 yield obj
206 }
207 }
208
209 const runStatement = (

Callers 2

runStatementFunction · 0.85
executeStreamFunction · 0.85

Calls 2

execMethod · 0.80
rawMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…