(sql: string, params: ReadonlyArray<unknown> = [])
| 70 | } |
| 71 | |
| 72 | const run = (sql: string, params: ReadonlyArray<unknown> = []) => |
| 73 | Effect.withFiber<Array<Record<string, unknown>>, SqlError>((fiber) => { |
| 74 | const statement = db.prepare(sql) |
| 75 | statement.setReadBigInts(Context.get(fiber.context, Client.SafeIntegers)) |
| 76 | try { |
| 77 | return Effect.succeed(statement.all(...(params as SQLInputValue[])) as Array<Record<string, unknown>>) |
| 78 | } catch (cause) { |
| 79 | return Effect.fail( |
| 80 | new SqlError({ |
| 81 | reason: classifySqliteError(cause, { message: "Failed to execute statement", operation: "execute" }), |
| 82 | }), |
| 83 | ) |
| 84 | } |
| 85 | }) |
| 86 | |
| 87 | const runValues = (sql: string, params: ReadonlyArray<unknown> = []) => |
| 88 | Effect.withFiber<ReadonlyArray<ReadonlyArray<unknown>>, SqlError>((fiber) => { |
no test coverage detected