(
sql: string,
params: ReadonlyArray<unknown>,
raw = false
)
| 167 | raw: boolean |
| 168 | ) => |
| 169 | Effect.withFiber<ReadonlyArray<any>, SqlError>((fiber) => { |
| 170 | const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers) |
| 171 | return Effect.try({ |
| 172 | try: () => { |
| 173 | statement.setReadBigInts(useSafeIntegers) |
| 174 | if (statement.columns().length > 0) { |
| 175 | return statement.all(...(params as Array<any>)) as ReadonlyArray<any> |
| 176 | } |
| 177 | const result = statement.run(...(params as Array<any>)) |
| 178 | return raw ? { changes: result.changes, lastInsertRowid: result.lastInsertRowid } as any : [] |
| 179 | }, |
| 180 | catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") }) |
no test coverage detected