mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-17 14:30:40 +01:00
feat: Configure database
This commit is contained in:
parent
e9af28f22f
commit
9ce6743948
@ -65,8 +65,16 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase {
|
|||||||
final path = await _findDatabasePath(client);
|
final path = await _findDatabasePath(client);
|
||||||
try {
|
try {
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
//opensqflite.open.overrideFor(sqlite3.OperatingSystem.android, openCipherOnAndroid);
|
final db = await sqflite.openDatabase(
|
||||||
final db = await sqflite.openDatabase(path, password: password);
|
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;
|
return db;
|
||||||
}
|
}
|
||||||
final db = await ffi.databaseFactoryFfi.openDatabase(path);
|
final db = await ffi.databaseFactoryFfi.openDatabase(path);
|
||||||
|
@ -357,7 +357,7 @@ packages:
|
|||||||
name: fluffybox
|
name: fluffybox
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.4"
|
version: "0.1.5"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user