Hi team, Iām reading through the api cljdoc but get a bit confused about conn and db. For example:
In the entry for datoms, the example code there uses db
(d/transact db [{:db/id 5 :name "Oleg"}
{:db/id 5 :likes "candy"}
{:db/id 5 :likes "pie"}
{:db/id 5 :likes "pizza"}])
In the entry for transact, it uses conn instead:
;; add a single datom to an existing entity (1)
(transact conn [[:db/add 1 :name "Ivan"]])
Can I assume they are the same and I should use conn whenever possible, as suggested in the entry for db :
(db conn)
Returns the underlying immutable database value from a connection.
Exists for Datomic API compatibility. Prefer using @conn directly if possible.
As there is a mixed use of conn and db through the doc, should I use just conn in most cases (say, read from and write to the db)?@conn equivalent to (db conn) this what you use for querying or reading.
The whenever you transact use conn
@errelinaaron āļø