cgrand / enlivez

8 stars 0 forks source link

Unique composite key on rows #6

Closed cgrand closed 5 years ago

cgrand commented 5 years ago

Given a query how do I determine a subset of columns that are enough to uniquely identify a row?

cgrand commented 5 years ago

For example:

[:ul
 (with {:db/id item [title done] :item/attrs}
   [:li title])]

This query returns 3 columns but item is enough for the identity of the row.

cgrand commented 5 years ago

All columns which are cardinality-one attributes of another column are not key. It works transitively too.