(database: IDatabase)
| 80 | } |
| 81 | |
| 82 | async function configureDatabaseConnection(database: IDatabase): Promise<void> { |
| 83 | try { |
| 84 | await database.execute("PRAGMA journal_mode = WAL"); |
| 85 | } catch { |
| 86 | // Some adapters may not support WAL mode changes |
| 87 | } |
| 88 | try { |
| 89 | await database.execute("PRAGMA synchronous = NORMAL"); |
| 90 | } catch { |
| 91 | // Some adapters may not support synchronous mode changes |
| 92 | } |
| 93 | try { |
| 94 | await database.execute("PRAGMA foreign_keys = ON"); |
| 95 | } catch { |
| 96 | // Some adapters may not support PRAGMA configuration |
| 97 | } |
| 98 | try { |
| 99 | await database.execute("PRAGMA busy_timeout = 15000"); |
| 100 | } catch { |
| 101 | // Some adapters may not support PRAGMA configuration |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | export async function cleanupOrphanedSyncRows(databaseArg?: IDatabase): Promise<void> { |
| 106 | const database = databaseArg ?? (await getDB()); |
no test coverage detected