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

Function runValues

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

Source from the content-addressed store, hash-verified

185 })
186
187 const runValues = (
188 sql: string,
189 params: ReadonlyArray<unknown> = []
190 ) =>
191 Effect.withFiber<Array<any>, SqlError>((fiber) => {
192 if (fiber.getRef(AsyncQuery)) {
193 return Effect.map(
194 Effect.tryPromise({
195 try: () => db.executeRaw(sql, params as Array<any>),
196 catch: (cause) =>
197 new SqlError({ reason: classifyError(cause, "Failed to execute statement (async)", "execute") })
198 }),
199 (result) => result.rawRows
200 )
201 }
202 return Effect.try({
203 try: () => db.executeRawSync(sql, params as Array<any>).rawRows,
204 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })
205 })
206 })
207
208 return identity<SqliteConnection>({
209 execute(sql, params, transformRows) {

Callers 2

executeValuesFunction · 0.70
executeValuesUnpreparedFunction · 0.70

Calls 4

getRefMethod · 0.80
classifyErrorFunction · 0.70
mapMethod · 0.45
executeRawMethod · 0.45

Tested by

no test coverage detected