map method

  1. @override
SessionRow 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
SessionRow map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return SessionRow(
    id: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}id'],
    )!,
    ip: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}ip'],
    )!,
    userAgent: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}user_agent'],
    )!,
    lastActivatedAt: $SessionsTable.$converterlastActivatedAt.fromSql(
      attachedDatabase.typeMapping.read(
        DriftSqlType.int,
        data['${effectivePrefix}last_activated_at'],
      )!,
    ),
  );
}