Expand internal representation of an Attribute to represent idea of absence #285
Labels
No labels
A-build
A-cli
A-core
A-design
A-edn
A-ffi
A-query
A-sdk
A-sdk-android
A-sdk-ios
A-sync
A-transact
A-views
A-vocab
P-Android
P-desktop
P-iOS
bug
correctness
dependencies
dev-ergonomics
discussion
documentation
duplicate
enhancement
enquiry
good first bug
good first issue
help wanted
hygiene
in progress
invalid
question
ready
size
speed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/mentat#285
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Vague problem statement:
To better support of retracting schema (as part of the timelines work, see #783), we need to have more knowledge than is currently available in-memory. Mentat's definition of a schema attribute currently does not allow us to determine if a particular schema attribute is actually present in the datoms, or if it's a derived default value.
E.g. if we did not assert
[:db/add 100 :db/index true]
, then theindex
field in theAttribute
struct for entid=100 will befalse
. From the point of view of schema retraction, meaning of thatfalse
value is not the same as if actually asserted that[:db/add 100 :db/index false]
.:db/ident
is being retracted, and that entity is a schema attribute - that is, it also has:db/valueType
and:db/cardinality
- these datoms (and any optional ones) must also be retracted. (why leave around dangling schema attributes?):db/valueType
,:db/cardinality
), then all of the required schema attributes must be retracted, as well as a corresponding:db/ident
.However, currently we can't tell by just inspecting an
AttributeMap
that a given entity has these attributes. And so to enforce rule 1, we must readdatoms
from disk.Implementation of schema retraction introduced in #783 punts on rule 1, and only enforces rule 2.