unusableReason property

String? get unusableReason

Why this key cannot stand in for a unique constraint, or null when it can. Written for a diagnostic, so it reads as a reason.

Implementation

String? get unusableReason {
  if (isDisabled) return 'the index is disabled';
  if (filterSql != null) {
    return 'it is a filtered index (WHERE $filterSql), so it is unique only '
        'among the rows matching that filter';
  }
  return null;
}