Skip to content
Kristian Mandrup edited this page Feb 27, 2016 · 14 revisions

Here an overview of the Datascript API exported for use from Javascript

datascript.core

q // dq/q
entity // de/entity
entity-db(entity)

datom // db/datom

pull dp/pull)
pull-many dp/pull-many
touch de/touch

empty-db // db/empty-db
init-db // db/init-db

datom? // db/datom?
db? // db/db?
tx0 // db/tx0
filter(db pred)
with(db tx-data tx-meta)
db-with(db tx-data)
datoms(db index c1 c2 c3 c4])
seek-datoms(db index c1 c2 c3 c4)

index-range(db attr start end)
entid // db/entid

conn?(conn)
conn-from-db(db)
  (atom db :meta { :listeners (atom {}) }))

conn-from-datoms(datoms schema)

create-conn(schema)

transact!(conn tx-data tx-meta)
reset-conn!(conn db tx-meta)
listen!(conn callback)
listen!(conn key callback)

unlisten!(conn key)
tempid(part x)
resolve-tempid(_db tempids tempid)

db(conn)

transact(conn tx-data tx-meta)

transact-async()
squuid(msec)
squuid-time-millis(uuid)

Clone this wiki locally