(query: string, params: ReadonlyArray<unknown> = [])
| 54 | : undefined |
| 55 | |
| 56 | const run = (query: string, params: ReadonlyArray<unknown> = []) => |
| 57 | Effect.withFiber<Array<Record<string, unknown>>, SqlError>((fiber) => { |
| 58 | const statement = native.query(query) |
| 59 | // @ts-ignore bun-types missing safeIntegers method, fixed in https://github.com/oven-sh/bun/pull/26627 |
| 60 | statement.safeIntegers(Context.get(fiber.context, Client.SafeIntegers)) |
| 61 | try { |
| 62 | return Effect.succeed((statement.all(...(params as any)) ?? []) as Array<Record<string, unknown>>) |
| 63 | } catch (cause) { |
| 64 | return Effect.fail( |
| 65 | new SqlError({ |
| 66 | reason: classifySqliteError(cause, { message: "Failed to execute statement", operation: "execute" }), |
| 67 | }), |
| 68 | ) |
| 69 | } |
| 70 | }) |
| 71 | |
| 72 | const runValues = (query: string, params: ReadonlyArray<unknown> = []) => |
| 73 | Effect.withFiber<Array<unknown[]>, SqlError>((fiber) => { |
no test coverage detected