Focus on this lines:
res (d/transact conn [{:user/id user-id
:user/email email
:user/verification-token token}])
db-after (d/db conn)
d/transact
returns a "future". The transaction is not completed yet
Calling d/db
immediately after d/transact
, it will get a db before the transaction.
To fix that:
@(d/transact ...
{:keys [db-after]} @(d/transact
Also a few tips:
check-schema
, should receive a db, not a conn.(d/pull db '[*] :user/id)
do pull the schemadatomic.client.api
or datomic.api
. The com.datomic/local
dependency provides the datomic.client.api
. The client API uses this transact syntax: (d/transact conn {:tx-data [....]})