isUnique method

bool isUnique(
  1. List<String> columns
)

Whether columns is covered by a unique index or constraint that holds for every row.

A filtered index — WHERE IsDeleted = 0 — does not count. It guarantees uniqueness only among the rows it covers, so treating one as a unique key would generate a find that can return the wrong row and a one-to-one relation that can have two children.

Implementation

bool isUnique(List<String> columns) =>
    uniqueKeyFor(columns, requireUnconditional: true) != null;