datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
2019-07-18T16:31:46.020400Z

Is it possible to serialize, or/and save to a file a DS db?

2019-07-18T16:51:55.021200Z

cool thx @carkh!

2019-07-18T18:26:33.022300Z

How would I specify uniqueness with compound attributes, e.g. by [:first-name :last-name] with :db/unique in a DS schma?

carkh 2019-07-18T18:39:34.023600Z

@kingcode that's a sore point about datascript ...i've been going around that problem by adding these compound values as regular attributes... Unlike datomic (afaik), datascript attributes accept compound data

carkh 2019-07-18T18:40:46.024300Z

or you could go more free form, and access your database in a more "graph database" way

carkh 2019-07-18T18:42:47.024800Z

or just check this constraint in your business layer

2019-07-18T18:58:08.026Z

ok thanks @carkh - so I might try :name [“first” “last”] and specify :name as :db/unique right?

carkh 2019-07-18T18:58:16.026200Z

yes

2019-07-18T18:58:28.026400Z

Thx!

carkh 2019-07-18T18:59:34.027100Z

i usually have both :customer/first-name and :customer/last-name ...and the :customer/full-name