add saf directory display fix
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user