(
sql: string,
params: ReadonlyArray<unknown> = []
)
| 163 | }) |
| 164 | |
| 165 | const runValues = ( |
| 166 | sql: string, |
| 167 | params: ReadonlyArray<unknown> = [] |
| 168 | ) => |
| 169 | Effect.withFiber<Array<any>, SqlError>((fiber) => { |
| 170 | if (fiber.getRef(AsyncQuery)) { |
| 171 | return Effect.tryPromise({ |
| 172 | try: () => db.executeRaw(sql, params as Array<any>), |
| 173 | catch: (cause) => |
| 174 | new SqlError({ reason: classifyError(cause, "Failed to execute statement (async)", "execute") }) |
| 175 | }) |
| 176 | } |
| 177 | return Effect.try({ |
| 178 | try: () => db.executeRawSync(sql, params as Array<any>), |
| 179 | catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to execute statement", "execute") }) |
| 180 | }) |
| 181 | }) |
| 182 | |
| 183 | return identity<SqliteConnection>({ |
| 184 | execute(sql, params, transformRows) { |
no test coverage detected