-
-
Notifications
You must be signed in to change notification settings - Fork 311
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 _
. Special characters such as ?
and !
are munged such that assoc!
is compiled to assoc_BANG_
and so on...
user=> (munge "assoc!")
"assoc_BANG_"
cljs.user=> (munge "q?")
"q_QMARK_"
empty_db(schema)
init_db(datoms..., schema)
q(query, sources)
pull(db pattern eid)
pull_many(db, pattern, eids)
db_with(db, entities)
entity(db, eid)
touch // d/touch
entity_db // d/entity-db
filter // d/filter
is_filtered // d/is-filtered
create_conn(schema)
conn_from_db // d/conn-from-db
conn_from_datoms
db(conn)
transact(conn, entities..., tx-meta)
reset_conn(conn, db, tx-meta)
listen // d/listen!
unlisten // d/unlisten!
resolve_tempid(tempids, tempid)
datoms(db, index, components)
seek_datoms(db, index, components)
index_range(db, attr, start end)
squuid()
squuid_time_millis(uuid)
q // dq/q
entity(db eid)
entity_db(entity)
datom(e, a, v, tx, added)
pull(db, selector, eid)
pull_many(db, selector, eids)
touch de/touch
empty_db(schema)
init_db(datoms, schema)
datom_QMARK_ // db/datom?
db_QMARK_ // 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_QMARK_(conn)
conn_from_db(db)
(atom db :meta { :listeners (atom {}) }))
conn_from_datoms(datoms schema)
create_conn(schema)
transact_BANG_(conn tx-data tx-meta)
reset_conn!(conn db tx-meta)
listen_BANG_(conn callback)
listen_BANG_(conn key callback)
unlisten_BANG_(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)