map method

  1. @override
Score map(
  1. Map<String, dynamic> data, {
  2. String? tablePrefix,
})
override

Maps the given row returned by the database into the fitting data class.

Implementation

@override
Score map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return Score(
    id: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}id'],
    )!,
    user: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}user'],
    )!,
    semester: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}semester'],
    )!,
    course: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}course'],
    )!,
    courseOffering: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}course_offering'],
    ),
    score: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}score'],
    ),
    status: $ScoresTable.$converterstatusn.fromSql(
      attachedDatabase.typeMapping.read(
        DriftSqlType.string,
        data['${effectivePrefix}status'],
      ),
    ),
  );
}