added noResult param to batch.commit to speed it up

This commit is contained in:
BroodjeAap 2020-11-09 17:39:10 +01:00
parent 15e4513b0f
commit 0e740eba16

View file

@ -1,8 +1,12 @@
import 'dart:async';
import 'dart:core';
import 'package:ohthatsa/pages/practice/PracticeAnswer.dart';
import 'package:ohthatsa/pages/practice/PracticeType.dart';
import 'package:sqflite/sqflite.dart';
import 'package:path/path.dart';
class PracticeDatabase {
static _onCreate(Database database, int version) async {
String types = PracticeType.values.map((type) => "'${type.toString().split(".").last}'").join(", ");
@ -48,6 +52,6 @@ class PracticeDatabase {
answer.sessionId = sessionId;
batch.insert("PracticeAnswer", answer.toMap());
});
await batch.commit();
await batch.commit(noResult: true);
}
}