parseDbDateTime function
Parses a timestamp column value (driver-specific: DateTime, ISO string
or epoch milliseconds).
Implementation
DateTime? parseDbDateTime(Object? value) => switch (value) {
null => null,
DateTime() => value.toUtc(),
int() => DateTime.fromMillisecondsSinceEpoch(value, isUtc: true),
String() when value.isEmpty => null,
String() => DateTime.tryParse(value)?.toUtc(),
_ => null,
};