tonsky / tonsky/datascript

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.

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

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?

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.