(
statement: Sqlite.Statement,
params: ReadonlyArray<unknown>,
raw: boolean
)
| 120 | }) |
| 121 | |
| 122 | const runStatement = ( |
| 123 | statement: Sqlite.Statement, |
| 124 | params: ReadonlyArray<unknown>, |
| 125 | raw: boolean |
| 126 | ) => |
| 127 | Effect.withFiberRuntime<ReadonlyArray<any>, SqlError>((fiber) => { |
| 128 | if (Context.get(fiber.currentContext, Client.SafeIntegers)) { |
| 129 | statement.safeIntegers(true) |
| 130 | } |
| 131 | try { |
| 132 | if (statement.reader) { |
| 133 | return Effect.succeed(statement.all(...params)) |
| 134 | } |
| 135 | const result = statement.run(...params) |
| 136 | return Effect.succeed(raw ? result as unknown as ReadonlyArray<any> : []) |
| 137 | } catch (cause) { |
| 138 | return Effect.fail(new SqlError({ cause, message: "Failed to execute statement" })) |
| 139 | } |
| 140 | }) |
| 141 | |
| 142 | const run = ( |
| 143 | sql: string, |
no test coverage detected
searching dependent graphs…