Differences to Datomic Client API
September 4, 2026 ยท View on GitHub
Although Datahike supports a part of Datomic's
API, some
behavior is different using the different functions. Datahike supports part of the datomic.client.api:
Without differences in the signature you may use the following like in Datomic:
Please be aware that q returns sets instead of vectors. Only when using aggregates or :with, q returns a
vector. That is the behavior of Datascript.
The following functions from the datahike.api namespace are different from Datomic's client API:
- connect
- create-database
- database-exists?
- db-with
- delete-database
- entity
- entity-db
- filter
- is-filtered
- load-entities
- pull-many
- release
- seek-datoms
- tempid
- with
Additionally, datahike supports most functions from datascript
in the datahike.api namespace.
These functions of Datomic are not yet implemented but considered candidates for future development:
- tx-range
- index-pull
- with-db
These functions are part of Datomics' distributed implementation and are currently not part of the Datahike API:
- client
- administer-system
- db-stats
- list-databases
- sync
Async support is on our roadmap as well as running distributed Datahike.
connect
Connects to an existing database given the configuration hash-map where Datomic takes a client as argument. The specification for the configuration can be found here.
create-database
Creates a new database with the given configuration hash-map where Datomic takes a client and an
arg-map as arguments. Additional optional parameters are schema-flexibility, keep-history?
and initial-tx. Have a look at the configuration documentation for details.
delete-database
Deletes a database with the configuration hash-map as argument.
database-exists?
Checks if a database exists with the configuration hash-map as argument.
db
Since the database can be just de-referenced from the connection this function is just a small wrapper for Datomic compliance.
(db conn)
equivalent to:
@conn
transact
Returns a hash map different from Datomics' as a report. The :tx-meta is not part
of Datomics' transaction report but apart from that the same keys are present. The
values are different records though.
with
Applies transactions to an immutable database value and returns a new database
snapshot. It does not change the mutable database inside the connection unlike
transact. It works quite the same as Datomics' with but does
not need a with-db function to work.
Functions in queries
A Datomic peer calls any function or Java method on its classpath from a
query; Datomic Cloud requires custom functions to be deployed as ions and
listed under :allow. Datahike embedded behaves like the peer. The Datahike
server resolves only a curated pure subset of clojure.core, clojure.string
and functions registered with datahike.query.resolve/register-fn! or
register-ns!, the counterpart of the ion allow-list; see
http-routes.md.