I want to use Datomic partitions to improve the scalability of my app.
First, I first created a partition in a transaction :
{:db/id "communities"
:db/ident :communities}
[:db/add :db.part/db :db.install/partition "communities"]
Second, I created the database schema in another transaction:
{:db/ident :person/name
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db.install/_attribute :communities}
{:db/ident :person/age
:db/valueType :db.type/int
:db/cardinality :db.cardinality/one
:db.install/_attribute :communities}
{:db/ident :person/sibblings
:db/valueType :db.type/int
:db/cardinality :db.cardinality/one
:db.install/_attribute :communities}
And here is an example of a simple query:
(d/q '[:find ?name ?age
:where
[?p :person/name ?name]
[?p :person/age ?age]]
db)
When I issue this query, I get the following error:
Unhandled datomic.impl.Exceptions$IllegalArgumentExceptionInfo :db.error/not-an-entity Unable to resolve entity: :person/name {:db/error :db.error/not-an-entity}
When I replace :db.install/_attribute :communities by :db.install/_attribute :db.part/db for every attribute, the query works fine. I have the same problem for all my other queries.
Am I missing something ?