1
votes

Looking at the tutorial documents, I've tried creating a partition by loading my schema from a file, which, among other things, contains the following:

 {:db/id #db/id[:db.part/db],
  :db/ident :account,
  :db.install/_partition :db.part/db}

If I try inserting data with the following:

  (d/transact conn
              [{:db/id #db/id[:db.part/user -1]
                :validation/email email
                :validation/code  code}])

Everthing works as expected. But if I replace "user" with my partitions name "account", like this:

  (d/transact conn
              [{:db/id #db/id[:db.part/account -1]
                :validation/email email
                :validation/code  code}])

I get this error:

IllegalArgumentExceptionInfo :db.error/not-a-db-id Invalid db/id: #db/id[:db.part/account -1]  datomic.error/arg (error.clj:57)

What am I doing wrong? How can I even be sure that I've created the partitions?

1

1 Answers

3
votes

your partition name is :account, not :db.part/account.

this code below should work.

  (d/transact conn
              [{:db/id #db/id[:account -1]
                :validation/email email
                :validation/code  code}])

You can query for list of installed partitions like this

(d/q '[:find [?ident ...]
             :where
             [?e :db/ident ?ident]
             [_ :db.install/partition ?e]]
           db)
=> [:account :db.part/tx :db.part/user]