map method

  1. @override
StoredCheckpoint 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
StoredCheckpoint map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return StoredCheckpoint(
    accountKey: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}account_key'],
    )!,
    subscriptionId: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}subscription_id'],
    )!,
    seq: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}seq'],
    )!,
    updatedAt: attachedDatabase.typeMapping.read(
      DriftSqlType.dateTime,
      data['${effectivePrefix}updated_at'],
    )!,
  );
}