(
sql: string,
params: ReadonlyArray<unknown>
)
| 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") }) |
| 181 | }) |
| 182 | }) |
| 183 | |
| 184 | const runStatementValues = ( |
| 185 | statement: StatementSync, |
| 186 | params: ReadonlyArray<unknown> |
| 187 | ) => |
| 188 | Effect.withFiber<ReadonlyArray<ReadonlyArray<unknown>>, SqlError>((fiber) => { |
| 189 | const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers) |
| 190 | return Effect.try({ |
| 191 | try: () => { |
| 192 | statement.setReadBigInts(useSafeIntegers) |
| 193 | if (statement.columns().length > 0) { |
| 194 | return statement.all(...(params as Array<any>)) as unknown as ReadonlyArray<ReadonlyArray<unknown>> |
| 195 | } |
| 196 | statement.run(...(params as Array<any>)) |
| 197 | return [] |
| 198 | }, |
| 199 | catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") }) |
| 200 | }) |
| 201 | }) |
| 202 | |
| 203 | const runStatementValuesUnprepared = ( |
no test coverage detected
searching dependent graphs…