hasPrimaryKey property

bool get hasPrimaryKey

Whether a single row can be addressed at all.

A view and a heap without a primary key both answer no, and generated code for them omits find, getById and single-row writes rather than offering ones that cannot be defined.

Implementation

bool get hasPrimaryKey =>
    primaryKey != null && primaryKey!.columns.isNotEmpty;