Fork me on GitHub
#datascript
<
2019-07-18
>
kingcode16:07:46

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

kingcode18:07:33

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

carkh18:07:34

@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

carkh18:07:46

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

carkh18:07:47

or just check this constraint in your business layer

kingcode18:07:08

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

carkh18:07:34

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