Fork me on GitHub
#datomic
<
2017-11-05
>
zignd14:11:09

I have a possibly noob question about the Datomic libraries, I was following the Getting Started section in the Datomic Documentation and it only mentions the Client API to interact with the database, but one thing I noticed is that its examples regarding defining a schema are a bit different from the ones I found on the internet, its definitions are missing the :db/id #db/id[:db.part/db] and :db.install/_attribute :db.part/db parts in the maps. To tell you truth I seriously have no idea why it is necessary and I couldn't find documentation to help me learn about it, the only thing I found (http://docs.datomic.com/schema.html) is that it's related to defining a partition, but the documentation related to it uses it a bit differently:

[{:db/id "communities"
  :db/ident :communities}
 [:db/add :db.part/db :db.install/partition "communities"]]

zignd14:11:24

I have been defining the schema for my attributes like this using the Client API:

{:db/ident       :user/username
 :db/valueType   :db.type/string
 :db/unique      :db.unique/value
 :db/cardinality :db.cardinality/one}

zignd14:11:51

And it seems to be working, data is being stored in the database with an id. Does the Client API does that by default for me?

rauh14:11:33

@zignd Last paragraph of the link you included should answer your question.

zignd14:11:21

@rauh Oh, thanks for that! I ended up reading only some sections of this page! xD

sparkofreason15:11:17

@marshall We've previously discussed keeping data for multiple customers in a single DB rather than splitting into many DB's on a single transactor. Will that advice still apply for Datomic Cloud?