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

Function runValues

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

Source from the content-addressed store, hash-verified

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