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

Function runValues

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

Source from the content-addressed store, hash-verified

163 })
164
165 const runValues = (
166 sql: string,
167 params: ReadonlyArray<unknown> = []
168 ) =>
169 Effect.withFiber<Array<any>, SqlError>((fiber) => {
170 if (fiber.getRef(AsyncQuery)) {
171 return Effect.tryPromise({
172 try: () => db.executeRaw(sql, params as Array<any>),
173 catch: (cause) =>
174 new SqlError({ reason: classifyError(cause, "Failed to execute statement (async)", "execute") })
175 })
176 }
177 return Effect.try({
178 try: () => db.executeRawSync(sql, params as Array<any>),
179 catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })
180 })
181 })
182
183 return identity<SqliteConnection>({
184 execute(sql, params, transformRows) {

Callers 2

executeValuesFunction · 0.70
executeValuesUnpreparedFunction · 0.70

Calls 3

getRefMethod · 0.80
classifyErrorFunction · 0.70
executeRawMethod · 0.45

Tested by

no test coverage detected