add saf directory display fix

This commit is contained in:
m
2026-09-10 23:08:17 +02:00
parent 367073ed89
commit 76ed3aa66b
9 changed files with 323 additions and 51 deletions
+9
View File
@@ -98,6 +98,15 @@ export async function closeDatabase(): Promise<void> {
opening = null;
}
export async function checkpointDatabase(): Promise<void> {
try {
const db = await getDatabase();
await db.execAsync('PRAGMA wal_checkpoint(TRUNCATE)');
} catch {
// Best-effort : ne jamais faire échouer la sync sur un checkpoint.
}
}
export async function withTransaction<T>(
work: (db: SQLiteDatabase) => Promise<T>,
): Promise<T> {
+6 -1
View File
@@ -1,4 +1,9 @@
export { getDatabase, closeDatabase, withTransaction } from './client';
export {
getDatabase,
closeDatabase,
withTransaction,
checkpointDatabase,
} from './client';
export { migrateDatabase, type Migration, type MigrationDb } from './migrations';
export * from './repositories';
export type { AccessCheck, AccessSource } from './repositories/permissions';