map method

  1. @override
StoredActionStep 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
StoredActionStep map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return StoredActionStep(
    actionId: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}action_id'],
    )!,
    name: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}name'],
    )!,
    status: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}status'],
    )!,
    resultJson: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}result_json'],
    ),
    lastError: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}last_error'],
    ),
    updatedAt: attachedDatabase.typeMapping.read(
      DriftSqlType.dateTime,
      data['${effectivePrefix}updated_at'],
    )!,
  );
}