Pulling `:db/id` for a missing id gives different results than Datomic

Open
#187 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
clojure
Domain
database

Research direction

Start by reproducing the reported differences in pull and pull-many for missing entity IDs, using the Datomic behavior described in the issue as the reference. The work is done when missing IDs preserve the expected result shape and :db/id values match that behavior, with coverage for both cases.

Written by the indexing model from the issue text.

Description

In Datomic, if you pull :db/id for any eid x that doesn't exist, you get {:db/id x}. In DataScript, you get nil.

Further, (pull-many [:some/attr] missing-eids) evaluates to [] in DataScript, but (repeat (count missing-ids) nil) in Datomic (and of course, returns a vector of {:db/id x} when :db/id is pulled).

This bears some relation to #166.

Is this behavior you'd consider modifying to match that of Datomic?

Dominant language
Clojure
Stars
5.8k
Forks
318
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tonsky/datascript

All issues in tonsky/datascript

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.