(
statement: Sqlite.Statement,
params: ReadonlyArray<unknown>,
raw: boolean
)
| 147 | ) |
| 148 | db.exec(`PRAGMA busy_timeout = ${busyTimeout}`) |
| 149 | |
| 150 | if (options.disableWAL !== true) { |
| 151 | db.exec("PRAGMA journal_mode = WAL") |
| 152 | } |
| 153 | |
| 154 | const prepareCache = yield* Cache.make({ |
| 155 | capacity: options.prepareCacheSize ?? 200, |
| 156 | timeToLive: options.prepareCacheTTL ?? Duration.minutes(10), |
| 157 | lookup: (sql: string) => |
| 158 | Effect.try({ |
| 159 | try: () => db.prepare(sql), |
| 160 | catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to prepare statement", "prepare") }) |
| 161 | }) |
| 162 | }) |
| 163 | |
| 164 | const runStatement = ( |
| 165 | statement: StatementSync, |
| 166 | params: ReadonlyArray<unknown>, |
| 167 | raw: boolean |
| 168 | ) => |
| 169 | Effect.withFiber<ReadonlyArray<any>, SqlError>((fiber) => { |
| 170 | const useSafeIntegers = Context.get(fiber.context, Client.SafeIntegers) |
no test coverage detected
searching dependent graphs…