mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
pragma update and WAL checkpoint feat
This commit is contained in:
parent
63ebba671b
commit
35c3f7211f
@ -58,8 +58,9 @@ class Drift extends $Drift implements IDatabaseRepository {
|
||||
@override
|
||||
MigrationStrategy get migration => MigrationStrategy(
|
||||
beforeOpen: (details) async {
|
||||
await customStatement('PRAGMA journal_mode = WAL');
|
||||
await customStatement('PRAGMA foreign_keys = ON');
|
||||
await customStatement('PRAGMA synchronous = NORMAL');
|
||||
await customStatement('PRAGMA journal_mode = WAL');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -4,18 +4,26 @@ import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/providers/background_sync.provider.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
||||
|
||||
final _features = [
|
||||
_Features(
|
||||
_Feature(
|
||||
name: 'Sync Local',
|
||||
icon: Icons.photo_album_rounded,
|
||||
onTap: (ref) => ref.read(backgroundSyncProvider).syncLocal(),
|
||||
),
|
||||
_Features(
|
||||
_Feature(
|
||||
name: 'Sync Remote',
|
||||
icon: Icons.refresh_rounded,
|
||||
onTap: (ref) => ref.read(backgroundSyncProvider).syncRemote(),
|
||||
),
|
||||
_Feature(
|
||||
name: 'WAL Checkpoint',
|
||||
icon: Icons.save_rounded,
|
||||
onTap: (ref) => ref
|
||||
.read(driftProvider)
|
||||
.customStatement("pragma wal_checkpoint(truncate)"),
|
||||
),
|
||||
];
|
||||
|
||||
@RoutePage()
|
||||
@ -46,8 +54,8 @@ class FeatInDevPage extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _Features {
|
||||
const _Features({
|
||||
class _Feature {
|
||||
const _Feature({
|
||||
required this.name,
|
||||
required this.icon,
|
||||
required this.onTap,
|
||||
|
Loading…
x
Reference in New Issue
Block a user