-
Notifications
You must be signed in to change notification settings - Fork 312
Javascript API
Kristian Mandrup edited this page Feb 27, 2016
·
14 revisions
Here an overview of the Datascript API exported for use from Javascript.
- becomes _. What are the translation rule are for special characters such as ? and ! in method names?
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)