upsertStudent method
Returns the ID of an existing student row, or creates/updates one.
Implementation
Future<int> upsertStudent({required String studentId, String? name}) async {
return (await into(students).insertReturning(
StudentsCompanion.insert(
studentId: studentId,
name: Value(name),
),
onConflict: DoUpdate(
(old) => StudentsCompanion(name: Value(name)),
target: [students.studentId],
),
)).id;
}