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

Function run

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

Source from the content-addressed store, hash-verified

153 }
154
155 const run = (
156 sql: string,
157 params: ReadonlyArray<unknown> = []
158 ) =>
159 Effect.withFiber<Array<any>, SqlError>((fiber) => {
160 const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers)
161 try {
162 return Effect.succeed((prepare(sql, useSafeIntegers).all(...(params as any)) ?? []) as Array<any>)
163 } catch (cause) {
164 return Effect.fail(new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") }))
165 }
166 })
167
168 const runValues = (
169 sql: string,

Callers 3

layerFunction · 0.70
executeFunction · 0.70
executeRawFunction · 0.70

Calls 6

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

Tested by

no test coverage detected