| 153 | } |
| 154 | |
| 155 | const run = ( |
| 156 | sql: string, |
| 157 | params: ReadonlyArray<unknown> = [] |
| 158 | ) => |
| 159 | Effect.withFiber<Array<any>, SqlError>((fiber) => { |
| 160 | const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers) |
| 161 | try { |
| 162 | return Effect.succeed((prepare(sql, useSafeIntegers).all(...(params as any)) ?? []) as Array<any>) |
| 163 | } catch (cause) { |
| 164 | return Effect.fail(new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") })) |
| 165 | } |
| 166 | }) |
| 167 | |
| 168 | const runValues = ( |
| 169 | sql: string, |