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

Function runValues

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

Source from the content-addressed store, hash-verified

250 })
251
252 const runValues = (
253 sql: string,
254 params: ReadonlyArray<unknown> = []
255 ): Effect.Effect<ReadonlyArray<any>, SqlError, never> =>
256 Effect.try({
257 try: () =>
258 Array.from(sqlStorage.exec(sql, ...params).raw(), (row) => {
259 for (let i = 0; i < row.length; i++) {
260 const value = row[i]
261 if (value instanceof ArrayBuffer) {
262 row[i] = new Uint8Array(value) as any
263 }
264 }
265 return row
266 }),
267 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })
268 })
269
270 return identity<Connection>({
271 execute(sql, params, transformRows) {

Callers 2

executeValuesFunction · 0.70
executeValuesUnpreparedFunction · 0.70

Calls 4

fromMethod · 0.80
classifyErrorFunction · 0.70
rawMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected