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

Function run

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

Source from the content-addressed store, hash-verified

202 }
203
204 const run = (
205 sql: string,
206 params: ReadonlyArray<unknown> = []
207 ) =>
208 Effect.withFiber<Array<any>, SqlError>((fiber) => {
209 const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers)
210 try {
211 return Effect.succeed((prepare(sql, useSafeIntegers).all(...(params as any)) ?? []) as Array<any>)
212 } catch (cause) {
213 return Effect.fail(new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") }))
214 }
215 })
216
217 const runValues = (
218 sql: string,

Callers 3

layerFunction · 0.70
executeFunction · 0.70
executeRawFunction · 0.70

Calls 6

prepareFunction · 0.70
classifyErrorFunction · 0.70
getMethod · 0.65
allMethod · 0.65
failMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected