(
statement: StatementSync,
params: ReadonlyArray<unknown>,
raw: boolean
)
| 211 | }) |
| 212 | |
| 213 | const runStatement = ( |
| 214 | statement: StatementSync, |
| 215 | params: ReadonlyArray<unknown>, |
| 216 | raw: boolean |
| 217 | ) => |
| 218 | Effect.withFiber<ReadonlyArray<any>, SqlError>((fiber) => { |
| 219 | const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers) |
| 220 | return Effect.try({ |
| 221 | try: () => { |
| 222 | statement.setReadBigInts(useSafeIntegers) |
| 223 | if (!raw || statement.columns().length > 0) { |
| 224 | return statement.all(...(params as Array<any>)) as ReadonlyArray<any> |
| 225 | } |
| 226 | const result = statement.run(...(params as Array<any>)) |
| 227 | return { changes: result.changes, lastInsertRowid: result.lastInsertRowid } as any |
| 228 | }, |
| 229 | catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") }) |
| 230 | }) |
| 231 | }) |
| 232 | |
| 233 | const runStatementValues = ( |
| 234 | statement: StatementSync, |
no test coverage detected