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

Function runValues

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

Source from the content-addressed store, hash-verified

215 })
216
217 const runValues = (
218 sql: string,
219 params: ReadonlyArray<unknown> = []
220 ) =>
221 Effect.withFiber<Array<any>, SqlError>((fiber) => {
222 const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers)
223 try {
224 return Effect.succeed((prepare(sql, useSafeIntegers).values(...(params as any)) ?? []) as Array<any>)
225 } catch (cause) {
226 return Effect.fail(
227 new SqlError({ reason: classifyError(cause, "Failed to execute statement", "executeValues") })
228 )
229 }
230 })
231
232 return identity<SqliteConnection>({
233 isTransaction: () => db.inTransaction,

Callers 2

executeValuesFunction · 0.70
executeValuesUnpreparedFunction · 0.70

Calls 5

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

Tested by

no test coverage detected