Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

[tx] Wrap positive integer entids in an Entid newtype #190

@ncalexan

Description

@ncalexan

This is follow-up to #171 (comment) and #170. Right now, I'm representing positive integer entids as i64, since SQLite doesn't have an unsigned u64 type. It's an interesting challenge to really represent entids as an Entid newtype that is really u63. When I started, I didn't understand the rusqlite traits FromSql and ToSql; 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. Use OrderedFloat 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-transactIssues or requests in the transactor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions