map method

  1. @override
UserRegistration 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
UserRegistration map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return UserRegistration(
    year: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}year'],
    )!,
    term: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}term'],
    )!,
    className: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}class_name'],
    ),
    enrollmentStatus: $UserSemesterSummariesTable.$converterenrollmentStatusn
        .fromSql(
          attachedDatabase.typeMapping.read(
            DriftSqlType.string,
            data['${effectivePrefix}enrollment_status'],
          ),
        ),
  );
}