[tx] Wrap positive integer entids in an Entid newtype #104
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#104
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?
This is follow-up to https://github.com/mozilla/mentat/pull/171#discussion_r96086384 and #170. Right now, I'm representing positive integer entids as
i64
, since SQLite doesn't have an unsignedu64
type. It's an interesting challenge to really represent entids as anEntid
newtype that is reallyu63
. When I started, I didn't understand therusqlite
traitsFromSql
andToSql
; now that I do, this should be straight-forward. I'm filing this as a [good next bug], I guess, since it's not trivial. UseOrderedFloat
for inspiration and remember that it never makes sense to do arithmetic on entids.As a side benefit/hindrance while testing: this might allow Mentat to control the introduction of entids. The Clojure version accepted any integer as an entid, which was handy for testing but did not agree with Datomic. We might be able to make the only way to allocate an entid be via a tempid, which has good correctness properties: it'll be harder to make errors in transactions, and it'll be harder to pollute a datom store with disconnected components.