map method
Maps the given row returned by the database into the fitting data class.
Implementation
@override
DeviceResourceAuditData map(Map<String, dynamic> data,
{String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return DeviceResourceAuditData(
id: attachedDatabase.typeMapping
.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
createdAt: attachedDatabase.typeMapping
.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!,
cpuUsage: attachedDatabase.typeMapping
.read(DriftSqlType.double, data['${effectivePrefix}cpu_usage'])!,
ramInMB: attachedDatabase.typeMapping
.read(DriftSqlType.double, data['${effectivePrefix}ram_in_m_b'])!,
freeRamInMB: attachedDatabase.typeMapping.read(
DriftSqlType.double, data['${effectivePrefix}free_ram_in_m_b'])!,
storageInMB: attachedDatabase.typeMapping
.read(DriftSqlType.double, data['${effectivePrefix}storage_in_m_b'])!,
freeStorageInMB: attachedDatabase.typeMapping.read(
DriftSqlType.double, data['${effectivePrefix}free_storage_in_m_b'])!,
);
}