| 202 | } |
| 203 | |
| 204 | const run = ( |
| 205 | sql: string, |
| 206 | params: ReadonlyArray<unknown> = [] |
| 207 | ) => |
| 208 | Effect.withFiber<Array<any>, SqlError>((fiber) => { |
| 209 | const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers) |
| 210 | try { |
| 211 | return Effect.succeed((prepare(sql, useSafeIntegers).all(...(params as any)) ?? []) as Array<any>) |
| 212 | } catch (cause) { |
| 213 | return Effect.fail(new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })) |
| 214 | } |
| 215 | }) |
| 216 | |
| 217 | const runValues = ( |
| 218 | sql: string, |