MCPcopy
hub / github.com/Effect-TS/effect / runValues

Function runValues

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

Source from the content-addressed store, hash-verified

115 })
116
117 const runValues = (
118 sql: string,
119 params: ReadonlyArray<unknown> = []
120 ) =>
121 Effect.withFiberRuntime<Array<any>, SqlError>((fiber) => {
122 const useSafeIntegers = Context.get(fiber.currentContext, Client.SafeIntegers)
123 try {
124 const statement = db.query(sql)
125 // @ts-ignore bun-types missing safeIntegers method, fixed in https://github.com/oven-sh/bun/pull/26627
126 statement.safeIntegers(useSafeIntegers)
127 return Effect.succeed((statement.values(...(params as any)) ?? []) as Array<any>)
128 } catch (cause) {
129 return Effect.fail(new SqlError({ cause, message: "Failed to execute statement" }))
130 }
131 })
132
133 return identity<SqliteConnection>({
134 execute(sql, params, transformRows) {

Callers 1

executeValuesFunction · 0.70

Calls 3

getMethod · 0.65
failMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…