map method
override
Maps the given row returned by the database into the fitting data class.
Implementation
@override
UserModel map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return UserModel(
id: attachedDatabase.typeMapping
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
name: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}name'])!,
email: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}email'])!,
password: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}password'])!,
role: $UsersTable.$converterrole.fromSql(attachedDatabase.typeMapping
.read(DriftSqlType.int, data['${effectivePrefix}role'])!),
);
}