feat: Configure database

This commit is contained in:
Krille Fear 2021-11-18 10:46:08 +01:00
parent e9af28f22f
commit 9ce6743948
2 changed files with 11 additions and 3 deletions

View File

@ -65,8 +65,16 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
final path = await _findDatabasePath(client);
try {
if (Platform.isAndroid || Platform.isIOS) {
//opensqflite.open.overrideFor(sqlite3.OperatingSystem.android, openCipherOnAndroid);
final db = await sqflite.openDatabase(path, password: password);
final db = await sqflite.openDatabase(
path,
password: password,
onConfigure: (db) async {
await db.execute('PRAGMA page_size = 8192');
await db.execute('PRAGMA cache_size = 16384');
await db.execute('PRAGMA temp_store = MEMORY');
await db.rawQuery('PRAGMA journal_mode = WAL');
},
);
return db;
}
final db = await ffi.databaseFactoryFfi.openDatabase(path);

View File

@ -357,7 +357,7 @@ packages:
name: fluffybox
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
version: "0.1.5"
flutter:
dependency: "direct main"
description: flutter