datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
hindol 2020-04-12T17:35:07.012600Z

Hi, I just started playing around with DataScript today, so a complete beginner. Is this the correct way to pull everything from a db? Can I skip the :where clause entirely?

(d/q '[:find (pull ?e [*])
       :where
       [?e]]
     @ds)

2020-04-12T17:54:05.013100Z

That will work, but may pull duplicate records for nested component entities

2020-04-12T17:55:50.014600Z

Note that you cannot do that in Datomic however; It prevents you from executing certain queries that have the potential to request the entire db.

hindol 2020-04-12T17:56:50.015300Z

Okay, not that I need the specific query. Just getting the hang of it. How would you pull all entities from a db?

hindol 2020-04-12T18:59:16.016600Z

Is it possible to insert an arbitrary object into DataScript DB? I am sometimes getting an exception that the object is not comparable. Looks like DS tries to insert the object into a sorted set.