map method Null safety
override
Maps the given row returned by the database into the fitting data class.
Implementation
@override
FieldData map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return FieldData(
id: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}id'])!,
created: attachedDatabase.typeMapping
.read(DriftSqlType.dateTime, data['${effectivePrefix}created'])!,
updated: attachedDatabase.typeMapping
.read(DriftSqlType.dateTime, data['${effectivePrefix}updated'])!,
type: $FieldTable.$convertertype.fromSql(attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}type'])!),
name: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}name'])!,
system: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}system'])!,
required: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}required'])!,
unique: attachedDatabase.typeMapping
.read(DriftSqlType.bool, data['${effectivePrefix}unique'])!,
collectionId: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}collection_id'])!,
extra: attachedDatabase.typeMapping
.read(DriftSqlType.string, data['${effectivePrefix}extra'])!,
);
}