Skip to content

get-else fails when passed a lookup. #445

Description

@jjttjj

The datomic docs suggest any entity identifier is allowed for the entity argument passed to get-else. However in datascript an exception is thrown when a lookup vector is used.

(d/q
    '[:find ?maybe
      :in $ ?lookup
      :where [(get-else $ ?lookup ::number 0) ?maybe]]
    (d/db-with (d/empty-db {::id {:db/unique :db.unique/identity}})
      [{::id 123}])
    [::id 123])

Results in:

 ClassCastException class clojure.lang.PersistentVector cannot be cast to class java.lang.Number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions