datahike 0.7.1630

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/README.md +226 -0
  2. package/cljs.analyzer.api.js +427 -0
  3. package/cljs.analyzer.api.js.map +1 -0
  4. package/cljs.analyzer.impl.js +86 -0
  5. package/cljs.analyzer.impl.js.map +1 -0
  6. package/cljs.analyzer.impl.namespaces.js +219 -0
  7. package/cljs.analyzer.impl.namespaces.js.map +1 -0
  8. package/cljs.analyzer.js +7186 -0
  9. package/cljs.analyzer.js.map +1 -0
  10. package/cljs.analyzer.passes.and_or.js +141 -0
  11. package/cljs.analyzer.passes.and_or.js.map +1 -0
  12. package/cljs.analyzer.passes.js +104 -0
  13. package/cljs.analyzer.passes.js.map +1 -0
  14. package/cljs.cache.js +1145 -0
  15. package/cljs.cache.js.map +1 -0
  16. package/cljs.cache.wrapped.js +352 -0
  17. package/cljs.cache.wrapped.js.map +1 -0
  18. package/cljs.core.async.impl.buffers.js +489 -0
  19. package/cljs.core.async.impl.buffers.js.map +1 -0
  20. package/cljs.core.async.impl.channels.js +711 -0
  21. package/cljs.core.async.impl.channels.js.map +1 -0
  22. package/cljs.core.async.impl.dispatch.js +81 -0
  23. package/cljs.core.async.impl.dispatch.js.map +1 -0
  24. package/cljs.core.async.impl.ioc_helpers.js +192 -0
  25. package/cljs.core.async.impl.ioc_helpers.js.map +1 -0
  26. package/cljs.core.async.impl.protocols.js +368 -0
  27. package/cljs.core.async.impl.protocols.js.map +1 -0
  28. package/cljs.core.async.impl.timers.js +510 -0
  29. package/cljs.core.async.impl.timers.js.map +1 -0
  30. package/cljs.core.async.js +8813 -0
  31. package/cljs.core.async.js.map +1 -0
  32. package/cljs.core.js +38764 -0
  33. package/cljs.core.js.map +1 -0
  34. package/cljs.env.js +60 -0
  35. package/cljs.env.js.map +1 -0
  36. package/cljs.nodejs.js +80 -0
  37. package/cljs.nodejs.js.map +1 -0
  38. package/cljs.reader.js +462 -0
  39. package/cljs.reader.js.map +1 -0
  40. package/cljs.spec.alpha.js +5312 -0
  41. package/cljs.spec.alpha.js.map +1 -0
  42. package/cljs.spec.gen.alpha.js +2020 -0
  43. package/cljs.spec.gen.alpha.js.map +1 -0
  44. package/cljs.tagged_literals.js +103 -0
  45. package/cljs.tagged_literals.js.map +1 -0
  46. package/cljs.tools.reader.edn.js +960 -0
  47. package/cljs.tools.reader.edn.js.map +1 -0
  48. package/cljs.tools.reader.impl.commons.js +217 -0
  49. package/cljs.tools.reader.impl.commons.js.map +1 -0
  50. package/cljs.tools.reader.impl.errors.js +441 -0
  51. package/cljs.tools.reader.impl.errors.js.map +1 -0
  52. package/cljs.tools.reader.impl.inspect.js +182 -0
  53. package/cljs.tools.reader.impl.inspect.js.map +1 -0
  54. package/cljs.tools.reader.impl.utils.js +429 -0
  55. package/cljs.tools.reader.impl.utils.js.map +1 -0
  56. package/cljs.tools.reader.js +1830 -0
  57. package/cljs.tools.reader.js.map +1 -0
  58. package/cljs.tools.reader.reader_types.js +838 -0
  59. package/cljs.tools.reader.reader_types.js.map +1 -0
  60. package/cljs_env.js +18192 -0
  61. package/cljs_node_io.core.js +1278 -0
  62. package/cljs_node_io.core.js.map +1 -0
  63. package/cljs_node_io.file.js +918 -0
  64. package/cljs_node_io.file.js.map +1 -0
  65. package/cljs_node_io.fs.js +3911 -0
  66. package/cljs_node_io.fs.js.map +1 -0
  67. package/clojure.data.js +319 -0
  68. package/clojure.data.js.map +1 -0
  69. package/clojure.edn.js +119 -0
  70. package/clojure.edn.js.map +1 -0
  71. package/clojure.set.js +406 -0
  72. package/clojure.set.js.map +1 -0
  73. package/clojure.string.js +502 -0
  74. package/clojure.string.js.map +1 -0
  75. package/clojure.walk.js +156 -0
  76. package/clojure.walk.js.map +1 -0
  77. package/datahike.api.impl.js +621 -0
  78. package/datahike.api.impl.js.map +1 -0
  79. package/datahike.api.specification.js +85 -0
  80. package/datahike.api.specification.js.map +1 -0
  81. package/datahike.array.js +275 -0
  82. package/datahike.array.js.map +1 -0
  83. package/datahike.config.js +437 -0
  84. package/datahike.config.js.map +1 -0
  85. package/datahike.connections.js +55 -0
  86. package/datahike.connections.js.map +1 -0
  87. package/datahike.connector.js +1248 -0
  88. package/datahike.connector.js.map +1 -0
  89. package/datahike.constants.js +66 -0
  90. package/datahike.constants.js.map +1 -0
  91. package/datahike.core.js +628 -0
  92. package/datahike.core.js.map +1 -0
  93. package/datahike.datom.js +963 -0
  94. package/datahike.datom.js.map +1 -0
  95. package/datahike.db.interface.js +819 -0
  96. package/datahike.db.interface.js.map +1 -0
  97. package/datahike.db.js +3095 -0
  98. package/datahike.db.js.map +1 -0
  99. package/datahike.db.search.js +1004 -0
  100. package/datahike.db.search.js.map +1 -0
  101. package/datahike.db.transaction.js +1904 -0
  102. package/datahike.db.transaction.js.map +1 -0
  103. package/datahike.db.utils.js +642 -0
  104. package/datahike.db.utils.js.map +1 -0
  105. package/datahike.gc.js +1618 -0
  106. package/datahike.gc.js.map +1 -0
  107. package/datahike.impl.entity.js +604 -0
  108. package/datahike.impl.entity.js.map +1 -0
  109. package/datahike.index.interface.js +484 -0
  110. package/datahike.index.interface.js.map +1 -0
  111. package/datahike.index.js +50 -0
  112. package/datahike.index.js.map +1 -0
  113. package/datahike.index.persistent_set.js +1250 -0
  114. package/datahike.index.persistent_set.js.map +1 -0
  115. package/datahike.js.api.js +2211 -0
  116. package/datahike.js.api.js.map +1 -0
  117. package/datahike.lru.js +404 -0
  118. package/datahike.lru.js.map +1 -0
  119. package/datahike.pull_api.js +533 -0
  120. package/datahike.pull_api.js.map +1 -0
  121. package/datahike.query.js +11891 -0
  122. package/datahike.query.js.map +1 -0
  123. package/datahike.query_stats.js +152 -0
  124. package/datahike.query_stats.js.map +1 -0
  125. package/datahike.readers.js +166 -0
  126. package/datahike.readers.js.map +1 -0
  127. package/datahike.schema.js +251 -0
  128. package/datahike.schema.js.map +1 -0
  129. package/datahike.schema_cache.js +66 -0
  130. package/datahike.schema_cache.js.map +1 -0
  131. package/datahike.spec.js +70 -0
  132. package/datahike.spec.js.map +1 -0
  133. package/datahike.store.js +514 -0
  134. package/datahike.store.js.map +1 -0
  135. package/datahike.tools.js +436 -0
  136. package/datahike.tools.js.map +1 -0
  137. package/datahike.writer.js +3463 -0
  138. package/datahike.writer.js.map +1 -0
  139. package/datahike.writing.js +3168 -0
  140. package/datahike.writing.js.map +1 -0
  141. package/datalog.parser.impl.js +1421 -0
  142. package/datalog.parser.impl.js.map +1 -0
  143. package/datalog.parser.impl.proto.js +213 -0
  144. package/datalog.parser.impl.proto.js.map +1 -0
  145. package/datalog.parser.impl.util.js +117 -0
  146. package/datalog.parser.impl.util.js.map +1 -0
  147. package/datalog.parser.js +47 -0
  148. package/datalog.parser.js.map +1 -0
  149. package/datalog.parser.pull.js +2603 -0
  150. package/datalog.parser.pull.js.map +1 -0
  151. package/datalog.parser.type.js +7502 -0
  152. package/datalog.parser.type.js.map +1 -0
  153. package/datalog.parser.util.js +60 -0
  154. package/datalog.parser.util.js.map +1 -0
  155. package/environ.core.js +263 -0
  156. package/environ.core.js.map +1 -0
  157. package/fress.api.js +607 -0
  158. package/fress.api.js.map +1 -0
  159. package/fress.impl.adler32.js +435 -0
  160. package/fress.impl.adler32.js.map +1 -0
  161. package/fress.impl.bigint.js +185 -0
  162. package/fress.impl.bigint.js.map +1 -0
  163. package/fress.impl.buffer.js +1087 -0
  164. package/fress.impl.buffer.js.map +1 -0
  165. package/fress.impl.codes.js +105 -0
  166. package/fress.impl.codes.js.map +1 -0
  167. package/fress.impl.hopmap.js +603 -0
  168. package/fress.impl.hopmap.js.map +1 -0
  169. package/fress.impl.ranges.js +49 -0
  170. package/fress.impl.ranges.js.map +1 -0
  171. package/fress.impl.raw_input.js +837 -0
  172. package/fress.impl.raw_input.js.map +1 -0
  173. package/fress.impl.raw_output.js +653 -0
  174. package/fress.impl.raw_output.js.map +1 -0
  175. package/fress.impl.table.js +133 -0
  176. package/fress.impl.table.js.map +1 -0
  177. package/fress.reader.js +2312 -0
  178. package/fress.reader.js.map +1 -0
  179. package/fress.util.js +458 -0
  180. package/fress.util.js.map +1 -0
  181. package/fress.writer.js +2141 -0
  182. package/fress.writer.js.map +1 -0
  183. package/geheimnis.aes.js +132 -0
  184. package/geheimnis.aes.js.map +1 -0
  185. package/hasch.base64.js +42 -0
  186. package/hasch.base64.js.map +1 -0
  187. package/hasch.benc.js +201 -0
  188. package/hasch.benc.js.map +1 -0
  189. package/hasch.core.js +188 -0
  190. package/hasch.core.js.map +1 -0
  191. package/hasch.platform.js +221 -0
  192. package/hasch.platform.js.map +1 -0
  193. package/incognito.base.js +276 -0
  194. package/incognito.base.js.map +1 -0
  195. package/incognito.edn.js +54 -0
  196. package/incognito.edn.js.map +1 -0
  197. package/incognito.fressian.js +330 -0
  198. package/incognito.fressian.js.map +1 -0
  199. package/index.d.ts +660 -0
  200. package/is.simm.partial_cps.async.js +142 -0
  201. package/is.simm.partial_cps.async.js.map +1 -0
  202. package/is.simm.partial_cps.runtime.js +65 -0
  203. package/is.simm.partial_cps.runtime.js.map +1 -0
  204. package/is.simm.partial_cps.sequence.js +1255 -0
  205. package/is.simm.partial_cps.sequence.js.map +1 -0
  206. package/konserve.cache.js +2519 -0
  207. package/konserve.cache.js.map +1 -0
  208. package/konserve.compressor.js +502 -0
  209. package/konserve.compressor.js.map +1 -0
  210. package/konserve.core.js +8052 -0
  211. package/konserve.core.js.map +1 -0
  212. package/konserve.encryptor.js +553 -0
  213. package/konserve.encryptor.js.map +1 -0
  214. package/konserve.gc.js +541 -0
  215. package/konserve.gc.js.map +1 -0
  216. package/konserve.impl.defaults.js +8290 -0
  217. package/konserve.impl.defaults.js.map +1 -0
  218. package/konserve.impl.storage_layout.js +849 -0
  219. package/konserve.impl.storage_layout.js.map +1 -0
  220. package/konserve.memory.js +2102 -0
  221. package/konserve.memory.js.map +1 -0
  222. package/konserve.node_filestore.js +2951 -0
  223. package/konserve.node_filestore.js.map +1 -0
  224. package/konserve.protocols.js +590 -0
  225. package/konserve.protocols.js.map +1 -0
  226. package/konserve.serializers.js +562 -0
  227. package/konserve.serializers.js.map +1 -0
  228. package/konserve.store.js +2245 -0
  229. package/konserve.store.js.map +1 -0
  230. package/konserve.tiered.js +9574 -0
  231. package/konserve.tiered.js.map +1 -0
  232. package/konserve.utils.js +180 -0
  233. package/konserve.utils.js.map +1 -0
  234. package/me.tonsky.persistent_sorted_set.arrays.js +66 -0
  235. package/me.tonsky.persistent_sorted_set.arrays.js.map +1 -0
  236. package/me.tonsky.persistent_sorted_set.branch.js +2779 -0
  237. package/me.tonsky.persistent_sorted_set.branch.js.map +1 -0
  238. package/me.tonsky.persistent_sorted_set.btset.js +14196 -0
  239. package/me.tonsky.persistent_sorted_set.btset.js.map +1 -0
  240. package/me.tonsky.persistent_sorted_set.impl.node.js +324 -0
  241. package/me.tonsky.persistent_sorted_set.impl.node.js.map +1 -0
  242. package/me.tonsky.persistent_sorted_set.impl.storage.js +123 -0
  243. package/me.tonsky.persistent_sorted_set.impl.storage.js.map +1 -0
  244. package/me.tonsky.persistent_sorted_set.js +890 -0
  245. package/me.tonsky.persistent_sorted_set.js.map +1 -0
  246. package/me.tonsky.persistent_sorted_set.leaf.js +561 -0
  247. package/me.tonsky.persistent_sorted_set.leaf.js.map +1 -0
  248. package/me.tonsky.persistent_sorted_set.util.js +402 -0
  249. package/me.tonsky.persistent_sorted_set.util.js.map +1 -0
  250. package/medley.core.js +1857 -0
  251. package/medley.core.js.map +1 -0
  252. package/package.json +38 -0
  253. package/spec_tools.core.js +1925 -0
  254. package/spec_tools.core.js.map +1 -0
  255. package/spec_tools.data_spec.js +1291 -0
  256. package/spec_tools.data_spec.js.map +1 -0
  257. package/spec_tools.form.js +185 -0
  258. package/spec_tools.form.js.map +1 -0
  259. package/spec_tools.impl.js +362 -0
  260. package/spec_tools.impl.js.map +1 -0
  261. package/spec_tools.parse.js +427 -0
  262. package/spec_tools.parse.js.map +1 -0
  263. package/spec_tools.transform.js +288 -0
  264. package/spec_tools.transform.js.map +1 -0
  265. package/superv.async.js +8617 -0
  266. package/superv.async.js.map +1 -0
  267. package/tailrecursion.priority_map.js +994 -0
  268. package/tailrecursion.priority_map.js.map +1 -0
  269. package/taoensso.encore.js +12385 -0
  270. package/taoensso.encore.js.map +1 -0
  271. package/taoensso.timbre.appenders.core.js +239 -0
  272. package/taoensso.timbre.appenders.core.js.map +1 -0
  273. package/taoensso.timbre.js +1264 -0
  274. package/taoensso.timbre.js.map +1 -0
  275. package/taoensso.truss.impl.js +442 -0
  276. package/taoensso.truss.impl.js.map +1 -0
  277. package/taoensso.truss.js +743 -0
  278. package/taoensso.truss.js.map +1 -0
  279. package/test-config-keys.js +33 -0
  280. package/test-final.js +36 -0
  281. package/test-key-duplication.js +67 -0
  282. package/test.js +557 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["datahike/api/impl.cljc"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,mCAAA,nCAAMA,8EAAWC,WAAWC;AAA5B,AACE,IAAMC,MAAI,EACE,AAACC,qBAAKF,UAAc,EAAI,kCAAA,lCAACG,0BAAUH,oEACbA,QACA,iBAAAI,WAAA,kBAAA,AAAAC,gDAAA,sDAAA,2CAAA,uDAAA,wEAAA,wEAE0B,AAACK,eAAKV;IAFhCM,eAAA,AAAAC,0DAAAC,mCAAA,uDAAA,oBAAA,KAAA,GAAA,KAAA,8CAAA,qDAAA,KAAAC,gBAAA;AAAA,AAAA,0FAAA,sDAAA,2CAAA,uDAAA,wEAAA,wEAE0B,AAACC,eAAKV;GAFhC,OAAA,KAAA,MAAA,KAAA,KAAA;AAAA,AAAA,QAAAM,6CAAAA,2CAAAF,YAAAE,wBAAAF;MAHxB,2EAAA,2CAAA,0EAAA,9LAME,EAAI,AAACO,wBAAQX,cACT,AAACY,qBAAKZ,iHAAoBA,gBACV,iBAAAa,WAAA,kBAAA,AAAAR,gDAAA,8DAAA,2CAAA,uDAAA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AAAAhD,4BAAAgD;aAAA,AAAA1D,4CAAA0D,eAAA,pEAA8BE;YAA9B,AAAA5D,4CAAA0D,eAAA,nEAAqCG;UAArC,AAAA7D,4CAAA0D,eAAA,jEAA2CI;AAA3C,AACE,OAACC,mCAAgBnD,GAAGgD,OAAOC,MAAMC;;AAEnC,2BAAA,3BAAME,8DAAQpD;AAAd,AACE,OAACqD,oBACA,WAAKC,EAAEC,EAAEC;AAAT,AACE,GACE,EAAK,cAAArD,bAAUoD,qCACV,GAAK,kDAAA,hDAAI,AAACE,wCAAqBF,UACtB,AAACG,mCAAgBH,QACjB,AAACI,iCAAcJ;AAAM,0DAAA,WAAAK,9DAACC,+CAAOP,EAAEC;AAAV,AAAa,8GAAAK,vGAACE,wHAAQN;;;AAJ3D,GAKE,OAASD;AAA0B,0DAAA,WAAAQ,9DAACF,+CAAOP,EAAEE;AAAV,AAAa,8GAAAO,iBAAA,2CAAA,nKAACD,wNAAgBP;;;AALnE,AAMqCD;;;;GARxC,mCAUC,AAACU,+BAAYhE;;AAEhB,mCAAA,nCAAMiE,8EAAgBjE;AAAtB,AACE,OAACqD,oBACA,WAAKC,EAAEC,EAAEC;AAAT,AACE,IAAMU,uFACW,+CAAA,WAAAC,1DAACC,/EAGD,6CAAA,7CAACC;AAHD,AAAS,wEAAA,/DAAI,wCAAAF,xCAACV,iEACD,iCAAAU,jCAACR,wDACD,mCAAAQ,nCAACT;GAHdF;AAAjB,AAKE,GAAI,AAACc,uBAAOJ;AACVZ;;AACA,OAACiB,8CAAMjB,EAAEC,EAAEW;;GATlB,mCAWC,AAACM,gCAAaxE","names":["datahike.api.impl/transact!","connection","arg-map","arg","cljs.core/map?","cljs.core/contains?","G__70554","cljs.core.ex_info","fexpr__70553","taoensso.timbre._log_BANG_","taoensso.timbre/*config*","cljs.core/Delay","cljs.core/keys","cljs.core/vector?","cljs.core/seq?","G__70560","fexpr__70559","cljs.core/type","datahike.writer/transact!","datahike.api.impl/transact","var_args","args__5732__auto__","len__5726__auto__","i__5727__auto__","argseq__5733__auto__","cljs.core/IndexedSeq","datahike.api.impl/create-database","seq70569","self__5712__auto__","cljs.core/seq","args","c__21482__auto__","cljs.core.async.chan","cljs.core.async.impl.dispatch/run","f__21483__auto__","switch__21444__auto__","state_70594","state_val_70595","inst_70575","cljs.core.async.impl.ioc-helpers/take!","inst_70577","inst_70578","statearr-70598","statearr-70599","statearr-70600","inst_70580","inst_70581","inst_70582","cljs.core/PersistentHashMap","inst_70583","statearr-70601","inst_70592","statearr-70602","cljs.core.async.impl.ioc-helpers/return-chan","inst_70585","inst_70586","statearr-70603","inst_70588","inst_70589","statearr-70604","statearr-70605","statearr-70606","state-machine__21445__auto__","ret-value__21446__auto__","result__21447__auto__","cljs.core/keyword-identical?","ex__21448__auto__","e70607","statearr-70608","statearr-70609","cljs.core/first","state__21484__auto__","statearr-70610","cljs.core.async.impl.ioc-helpers/USER-START-IDX","cljs.core.async.impl.ioc-helpers/run-state-machine-wrapped","cljs.core.apply","datahike.writer/create-database","datahike.connector.connect","datahike.connector.release","datahike.api.impl/delete-database","seq70611","datahike.writer/delete-database","datahike.api.impl/database-exists?","config","datahike.writing.database_exists_QMARK_","js/datahike","js/datahike.api","js/datahike.api.impl","js/datahike.api.impl.datoms","method-table__5599__auto__","cljs.core.atom","prefer-table__5600__auto__","method-cache__5601__auto__","cached-hierarchy__5602__auto__","hierarchy__5603__auto__","cljs.core.get","fexpr__70612","cljs.core/MultiFn","cljs.core.symbol","datahike.api.impl/datoms","_db","index","_components","p__70613","map__70614","cljs.core/--destructure-map","cljs.core/PersistentArrayMap","db","components","datahike.db.interface/datoms","cljs.core/Keyword","js/datahike.api.impl.seek-datoms","fexpr__70615","datahike.api.impl/seek-datoms","p__70616","map__70617","datahike.db.interface/seek-datoms","G__70619","datahike.api.impl/with","js/Error","tx-data","tx-meta","datahike.api.impl.with$","datahike.core/is-filtered","G__70621","fexpr__70620","datahike.db.transaction/transact-tx-data","datahike.db/map->TxReport","datahike.api.impl/db-with","cljs.core/deref","datahike.api.impl/db","conn","datahike.api.impl/since","time-point","datahike.db.interface/-temporal-index?","datahike.db/SinceDB","G__70623","fexpr__70622","datahike.db.interface/-config","datahike.api.impl/as-of","cljs.core/int?","datahike.constants/tx0","datahike.db/AsOfDB","G__70625","cljs.core.pr_str","fexpr__70624","G__70627","fexpr__70626","datahike.api.impl/history","datahike.db/HistoricalDB","G__70629","fexpr__70628","p__70630","map__70631","datahike.api.impl/index-range","attrid","start","end","datahike.db.interface/index-range","datahike.api.impl/schema","cljs.core/reduce-kv","m","k","v","datahike.schema/entity-spec-attr?","datahike.schema/schema-attr?","datahike.schema/sys-ident?","p1__70632#","cljs.core.update","cljs.core.merge","p1__70633#","datahike.db.interface/-schema","datahike.api.impl/reverse-schema","attrs","p1__70634#","cljs.core.remove","cljs.core.into","cljs.core/empty?","cljs.core.assoc","datahike.db.interface/-rschema"],"sourcesContent":["(ns datahike.api.impl\n \"API input and backwards compatibility. This namespace only ensures\n compatibility and does not implement underlying functionality.\"\n (:refer-clojure :exclude [filter])\n (:require [datahike.connector :as dc]\n [datahike.config :as config]\n [clojure.spec.alpha :as s]\n [datahike.writer :as dw]\n [datahike.writing :as writing]\n [datahike.constants :as const]\n [datahike.core :as dcore]\n [datahike.spec :as spec]\n [datahike.pull-api :as dp]\n [datahike.query :as dq]\n [datahike.schema :as ds]\n [datahike.tools :as dt]\n [datahike.db :as db #?@(:cljs [:refer [HistoricalDB AsOfDB SinceDB FilteredDB]])]\n [datahike.db.interface :as dbi]\n [datahike.db.transaction :as dbt]\n [datahike.impl.entity :as de]\n #?(:cljs [clojure.core.async :as async :refer [<! >! chan put! close!]]))\n #?(:cljs (:require-macros [superv.async :refer [go-try- <?-]]\n [clojure.core.async :refer [go]]))\n #?(:clj\n (:import [clojure.lang Keyword PersistentArrayMap]\n [datahike.db HistoricalDB AsOfDB SinceDB FilteredDB]\n [datahike.impl.entity Entity])))\n\n(defn transact! [connection arg-map]\n (let [arg (cond\n (map? arg-map) (if (contains? arg-map :tx-data)\n arg-map\n (dt/raise \"Bad argument to transact, map missing key :tx-data.\"\n {:error :transact/syntax\n :argument-keys (keys arg-map)}))\n (or (vector? arg-map)\n (seq? arg-map)) {:tx-data arg-map}\n :else (dt/raise \"Bad argument to transact, expected map, vector or sequence.\"\n {:error :transact/syntax\n :argument-type (type arg-map)}))]\n (dw/transact! connection arg)))\n\n(defn transact [connection arg-map]\n #?(:clj\n @(transact! connection arg-map)\n :cljs (throw (ex-info \"Synchronous transact not supported in ClojureScript, use transact! instead.\"\n {:error :transact/sync-not-supported}))))\n\n;; necessary to support initial-tx shorthand, which really should have been avoided\n(defn create-database [& args]\n #?(:clj\n (let [config @(apply dw/create-database args)]\n (when-let [txs (:initial-tx config)]\n (let [conn (dc/connect config)]\n (transact conn txs)\n (dc/release conn)))\n config)\n :cljs\n (go\n (let [config (<! (apply dw/create-database args))]\n (when-let [txs (:initial-tx config)]\n (let [conn (<! (dc/connect config {:sync? false}))]\n (<! (transact! conn txs))\n (dc/release conn)))\n config))))\n\n(defn delete-database [& args]\n #?(:clj @(apply dw/delete-database args)\n :cljs (apply dw/delete-database args)))\n\n(defn database-exists? [config]\n #?(:clj @(writing/database-exists? config)\n :cljs (writing/database-exists? config)))\n\n(defmulti datoms\n (fn\n ([_db arg-map]\n (type arg-map))\n ([_db index & _components]\n (type index))))\n\n(defmethod datoms PersistentArrayMap\n [db {:keys [index components]}]\n (dbi/datoms db index components))\n\n(defmethod datoms Keyword\n [db index & components]\n (if (nil? components)\n (dbi/datoms db index [])\n (dbi/datoms db index components)))\n\n(defmulti seek-datoms\n (fn\n ([_db arg-map]\n (type arg-map))\n ([_db index & _components]\n (type index))))\n\n(defmethod seek-datoms PersistentArrayMap\n [db {:keys [index components]}]\n (dbi/seek-datoms db index components))\n\n(defmethod seek-datoms Keyword\n [db index & components]\n (if (nil? components)\n (dbi/seek-datoms db index [])\n (dbi/seek-datoms db index components)))\n\n(defn with\n ([db arg-map]\n (let [tx-data (if (:tx-data arg-map) (:tx-data arg-map) arg-map)\n tx-meta (if (:tx-meta arg-map) (:tx-meta arg-map) nil)]\n (with db tx-data tx-meta)))\n ([db tx-data tx-meta]\n (if (dcore/is-filtered db)\n (dt/raise \"Filtered DB cannot be modified\" {:error :transaction/filtered})\n (dbt/transact-tx-data (db/map->TxReport\n {:db-before db\n :db-after db\n :tx-data []\n :tempids {}\n :tx-meta tx-meta}) tx-data))))\n\n(defn db-with [db tx-data]\n (:db-after (with db tx-data)))\n\n(defn db [conn]\n @conn)\n\n(defn since [db time-point]\n (if (dbi/-temporal-index? db)\n (SinceDB. db time-point)\n (dt/raise \"since is only allowed on temporal indexed databases.\" {:config (dbi/-config db)})))\n\n(defn as-of [db time-point]\n (if (dbi/-temporal-index? db)\n (if (int? time-point)\n (if (<= const/tx0 time-point)\n (AsOfDB. db time-point)\n (dt/raise (str \"Invalid transaction ID. Must be bigger than \" const/tx0 \".\")\n {:time-point time-point}))\n (AsOfDB. db time-point))\n (dt/raise \"as-of is only allowed on temporal indexed databases.\" {:config (dbi/-config db)})))\n\n(defn history [db]\n (if (dbi/-temporal-index? db)\n (HistoricalDB. db)\n (dt/raise \"history is only allowed on temporal indexed databases.\" {:config (dbi/-config db)})))\n\n(defn index-range [db {:keys [attrid start end]}]\n (dbi/index-range db attrid start end))\n\n(defn schema [db]\n (reduce-kv\n (fn [m k v]\n (cond\n (and (keyword? k)\n (not (or (ds/entity-spec-attr? k)\n (ds/schema-attr? k)\n (ds/sys-ident? k)))) (update m k #(merge % v))\n (number? k) (update m v #(merge % {:db/id k}))\n :else m))\n {}\n (dbi/-schema db)))\n\n(defn reverse-schema [db]\n (reduce-kv\n (fn [m k v]\n (let [attrs (->> v\n (remove #(or (ds/entity-spec-attr? %)\n (ds/sys-ident? %)\n (ds/schema-attr? %)))\n (into #{}))]\n (if (empty? attrs)\n m\n (assoc m k attrs))))\n {}\n (dbi/-rschema db)))\n"]}
@@ -0,0 +1,85 @@
1
+ var $CLJS = require("./cljs_env");
2
+ var $jscomp = $CLJS.$jscomp;
3
+ var COMPILED = false;
4
+ require("./cljs.core.js");
5
+ require("./cljs.spec.alpha.js");
6
+ require("./datahike.spec.js");
7
+ var environ=$CLJS.environ || ($CLJS.environ = {});
8
+ var fress=$CLJS.fress || ($CLJS.fress = {});
9
+ var datahike=$CLJS.datahike || ($CLJS.datahike = {});
10
+ var clojure=$CLJS.clojure || ($CLJS.clojure = {});
11
+ var hasch=$CLJS.hasch || ($CLJS.hasch = {});
12
+ var tailrecursion=$CLJS.tailrecursion || ($CLJS.tailrecursion = {});
13
+ var superv=$CLJS.superv || ($CLJS.superv = {});
14
+ var geheimnis=$CLJS.geheimnis || ($CLJS.geheimnis = {});
15
+ var is=$CLJS.is || ($CLJS.is = {});
16
+ var cljs=$CLJS.cljs || ($CLJS.cljs = {});
17
+ var cljs_node_io=$CLJS.cljs_node_io || ($CLJS.cljs_node_io = {});
18
+ var goog=$CLJS.goog || ($CLJS.goog = {});
19
+ var konserve=$CLJS.konserve || ($CLJS.konserve = {});
20
+ var datalog=$CLJS.datalog || ($CLJS.datalog = {});
21
+ var spec_tools=$CLJS.spec_tools || ($CLJS.spec_tools = {});
22
+ var taoensso=$CLJS.taoensso || ($CLJS.taoensso = {});
23
+ var incognito=$CLJS.incognito || ($CLJS.incognito = {});
24
+ var medley=$CLJS.medley || ($CLJS.medley = {});
25
+ var me=$CLJS.me || ($CLJS.me = {});
26
+
27
+ $CLJS.SHADOW_ENV.setLoaded("datahike.api.specification.js");
28
+
29
+ goog.provide('datahike.api.specification');
30
+ /**
31
+ * Turns an API endpoint name into a URL.
32
+ */
33
+ datahike.api.specification.__GT_url = (function datahike$api$specification$__GT_url(name){
34
+ return cljs.core.str.cljs$core$IFn$_invoke$arity$1(name).replace("?","");
35
+ });
36
+ /**
37
+ * This function is a helper to translate a spec into a list of arguments. It is only complete enough to deal with the specs in this namespace.
38
+ */
39
+ datahike.api.specification.spec_args__GT_argslist = (function datahike$api$specification$spec_args__GT_argslist(s){
40
+ if((!(cljs.core.seq_QMARK_(s)))){
41
+ if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"nil","nil",99600501),s)){
42
+ return cljs.core.PersistentVector.EMPTY;
43
+ } else {
44
+ return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.symbol.cljs$core$IFn$_invoke$arity$1(cljs.core.name(s))], null);
45
+ }
46
+ } else {
47
+ var vec__70555 = s;
48
+ var seq__70556 = cljs.core.seq(vec__70555);
49
+ var first__70557 = cljs.core.first(seq__70556);
50
+ var seq__70556__$1 = cljs.core.next(seq__70556);
51
+ var op = first__70557;
52
+ var args = seq__70556__$1;
53
+ if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(op,new cljs.core.Symbol("s","cat","s/cat",182721371,null))){
54
+ return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.vec(cljs.core.mapcat.cljs$core$IFn$_invoke$arity$variadic((function (p__70558){
55
+ var vec__70561 = p__70558;
56
+ var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__70561,(0),null);
57
+ var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__70561,(1),null);
58
+ if(((cljs.core.seq_QMARK_(v)) && (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.first(v),new cljs.core.Symbol("s","*","s/*",345799260,null))))){
59
+ return cljs.core.vec(cljs.core.concat.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"&","&",-2144855648,null)], null),(datahike.api.specification.spec_args__GT_argslist.cljs$core$IFn$_invoke$arity$1 ? datahike.api.specification.spec_args__GT_argslist.cljs$core$IFn$_invoke$arity$1(k) : datahike.api.specification.spec_args__GT_argslist.call(null, k))));
60
+ } else {
61
+ return (datahike.api.specification.spec_args__GT_argslist.cljs$core$IFn$_invoke$arity$1 ? datahike.api.specification.spec_args__GT_argslist.cljs$core$IFn$_invoke$arity$1(k) : datahike.api.specification.spec_args__GT_argslist.call(null, k));
62
+ }
63
+ }),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([cljs.core.partition.cljs$core$IFn$_invoke$arity$2((2),args)], 0)))], null);
64
+ } else {
65
+ if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(op,new cljs.core.Symbol("s","alt","s/alt",1637316720,null))){
66
+ return cljs.core.vec(cljs.core.mapcat.cljs$core$IFn$_invoke$arity$variadic((function (p__70564){
67
+ var vec__70565 = p__70564;
68
+ var k = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__70565,(0),null);
69
+ var v = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__70565,(1),null);
70
+ if(cljs.core.seq_QMARK_(v)){
71
+ return (datahike.api.specification.spec_args__GT_argslist.cljs$core$IFn$_invoke$arity$1 ? datahike.api.specification.spec_args__GT_argslist.cljs$core$IFn$_invoke$arity$1(v) : datahike.api.specification.spec_args__GT_argslist.call(null, v));
72
+ } else {
73
+ return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.symbol.cljs$core$IFn$_invoke$arity$1(cljs.core.name(k))], null)], null);
74
+ }
75
+ }),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([cljs.core.partition.cljs$core$IFn$_invoke$arity$2((2),args)], 0)));
76
+ } else {
77
+ return cljs.core.PersistentVector.EMPTY;
78
+
79
+ }
80
+ }
81
+ }
82
+ });
83
+ datahike.api.specification.api_specification = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Symbol(null,"unlisten","unlisten",59551202,null),new cljs.core.Symbol(null,"delete-database","delete-database",-1092767134,null),new cljs.core.Symbol(null,"pull","pull",779986722,null),new cljs.core.Symbol(null,"entity","entity",1189561251,null),new cljs.core.Symbol(null,"metrics","metrics",2034624996,null),new cljs.core.Symbol(null,"reverse-schema","reverse-schema",968124964,null),new cljs.core.Symbol(null,"datoms","datoms",1349657093,null),new cljs.core.Symbol(null,"load-entities","load-entities",189988934,null),new cljs.core.Symbol(null,"is-filtered","is-filtered",230239847,null),new cljs.core.Symbol(null,"q","q",-1965434072,null),new cljs.core.Symbol(null,"schema","schema",58529736,null),new cljs.core.Symbol(null,"index-range","index-range",1044940937,null),new cljs.core.Symbol(null,"pull-many","pull-many",1857679657,null),new cljs.core.Symbol(null,"since","since",1955911369,null),new cljs.core.Symbol(null,"query-stats","query-stats",-794858260,null),new cljs.core.Symbol(null,"entity-db","entity-db",2062591917,null),new cljs.core.Symbol(null,"gc-storage","gc-storage",-1568591955,null),new cljs.core.Symbol(null,"create-database","create-database",2134140909,null),new cljs.core.Symbol(null,"db","db",-1661185010,null),new cljs.core.Symbol(null,"connect","connect",-1421607536,null),new cljs.core.Symbol(null,"release","release",106160146,null),new cljs.core.Symbol(null,"history","history",1393136307,null),new cljs.core.Symbol(null,"transact!","transact!",817805717,null),new cljs.core.Symbol(null,"database-exists?","database-exists?",417505719,null),new cljs.core.Symbol(null,"transact","transact",1372532857,null),new cljs.core.Symbol(null,"as-of","as-of",-201430855,null),new cljs.core.Symbol(null,"seek-datoms","seek-datoms",-1423344839,null),new cljs.core.Symbol(null,"filter","filter",691993593,null),new cljs.core.Symbol(null,"listen","listen",-1004931046,null),new cljs.core.Symbol(null,"db-with","db-with",233242042,null),new cljs.core.Symbol(null,"with","with",104234651,null),new cljs.core.Symbol(null,"tempid","tempid",-1226772547,null)],[new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Symbol(null,"any?","any?",-318999933,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"map?","map?",-1780568534,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Removes registered listener from connection. See also [[listen]].",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.core","unlisten!","datahike.core/unlisten!",-698844062,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"config","config",994861415),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"config","config",994861415),new cljs.core.Symbol("spec","SConfig","spec/SConfig",376364196,null)),new cljs.core.Keyword(null,"nil","nil",99600501),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"doc","doc",1913296891),"Deletes a database given via configuration map. Storage configuration `:store` is mandatory.\nFor more information refer to the [docs](https://github.com/replikativ/datahike/blob/master/doc/config.md)",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","delete-database","datahike.api.impl/delete-database",-1966076959,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"simple","simple",-581868663),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"opts","opts",155075701),new cljs.core.Symbol("spec","SPullOptions","spec/SPullOptions",-1954812912,null)),new cljs.core.Keyword(null,"full","full",436801220),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"selector","selector",762528866),new cljs.core.Symbol(null,"coll?","coll?",-1874821441,null),new cljs.core.Keyword(null,"eid","eid",559519930),new cljs.core.Symbol("spec","SEId","spec/SEId",1986561743,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol("s","nilable","s/nilable",-812128520,null),new cljs.core.Symbol(null,"map?","map?",-1780568534,null)),new cljs.core.Keyword(null,"doc","doc",1913296891),"Fetches data from database using recursive declarative description. See [docs.datomic.com/on-prem/pull.html](https://docs.datomic.com/on-prem/pull.html).\n\nUnlike [[entity]], returns plain Clojure map (not lazy).\n\nUsage:\n\n (pull db [:db/id, :name, :likes, {:friends [:db/id :name]}] 1) ; => {:db/id 1,\n :name \"Ivan\"\n :likes [:pizza]\n :friends [{:db/id 2, :name \"Oleg\"}]}\n\nThe arity-2 version takes :selector and :eid in arg-map.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.pull-api","pull","datahike.pull-api/pull",-749425329,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"eid","eid",559519930),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"eid","eid",559519930),new cljs.core.Symbol("spec","SEId","spec/SEId",1986561743,null),new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.Symbol(null,"any?","any?",-318999933,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol("s","nilable","s/nilable",-812128520,null),new cljs.core.Symbol("de","entity?","de/entity?",555337042,null)),new cljs.core.Keyword(null,"doc","doc",1913296891),"Retrieves an entity by its id from database. Entities are lazy map-like structures to navigate Datahike database content.\n\nFor `eid` pass entity id or lookup attr:\n\n (entity db 1)\n (entity db [:unique-attr :value])\n\nIf entity does not exist, `nil` is returned:\n\n (entity db -1) ; => nil\n\nCreating an entity by id is very cheap, almost no-op, as attr access is on-demand:\n\n (entity db 1) ; => {:db/id 1}\n\nEntity attributes can be lazily accessed through key lookups:\n\n (:attr (entity db 1)) ; => :value\n (get (entity db 1) :attr) ; => :value\n\nCardinality many attributes are returned sequences:\n\n (:attrs (entity db 1)) ; => [:v1 :v2 :v3]\n\nReference attributes are returned as another entities:\n\n (:ref (entity db 1)) ; => {:db/id 2}\n (:ns/ref (entity db 1)) ; => {:db/id 2}\n\nReferences can be walked backwards by prepending `_` to name part of an attribute:\n\n (:_ref (entity db 2)) ; => [{:db/id 1}]\n (:ns/_ref (entity db 2)) ; => [{:db/id 1}]\n\nReverse reference lookup returns sequence of entities unless attribute is marked as `:db/component`:\n\n (:_component-ref (entity db 2)) ; => {:db/id 1}\n\nEntity gotchas:\n\n- Entities print as map, but are not exactly maps (they have compatible get interface though).\n- Entities are effectively immutable \u201Cviews\u201D into a particular version of a database.\n- Entities retain reference to the whole database.\n- You can't change database through entities, only read.\n- Creating an entity by id is very cheap, almost no-op (attributes are looked up on demand).\n- Comparing entities just compares their ids. Be careful when comparing entities taken from different dbs or from different versions of the same db.\n- Accessed entity attributes are cached on entity itself (except backward references).\n- When printing, only cached attributes (the ones you have accessed before) are printed. See [[touch]].",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.impl.entity","entity","datahike.impl.entity/entity",-63623173,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SMetrics","spec/SMetrics",-1835026790,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns database metrics.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.db","metrics","datahike.db/metrics",-973141969,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"map?","map?",-1780568534,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns current reverse schema definition.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","reverse-schema","datahike.api.impl/reverse-schema",1974002339,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"map","map",1371690461),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Symbol("spec","SIndexLookupArgs","spec/SIndexLookupArgs",-203316249,null)),new cljs.core.Keyword(null,"key","key",-1516042587),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"index","index",-1531685915),new cljs.core.Symbol(null,"keyword?","keyword?",1917797069,null),new cljs.core.Keyword(null,"components","components",-1073188942),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"coll","coll",1647737163),cljs.core.list(new cljs.core.Symbol("s","*","s/*",345799260,null),new cljs.core.Symbol(null,"any?","any?",-318999933,null)),new cljs.core.Keyword(null,"nil","nil",99600501),new cljs.core.Symbol(null,"nil?","nil?",1612038930,null)))),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol("s","nilable","s/nilable",-812128520,null),new cljs.core.Symbol("spec","SDatoms","spec/SDatoms",1451063932,null)),new cljs.core.Keyword(null,"doc","doc",1913296891),"Index lookup. Returns a sequence of datoms (lazy iterator over actual DB index) which components\n(e, a, v) match passed arguments. Datoms are sorted in index sort order. Possible `index` values\nare: `:eavt`, `:aevt`, `:avet`.\n\nAccepts db and a map as arguments with the keys `:index` and `:components` provided within the\nmap, or the arguments provided separately.\n\n\nUsage:\n\nSet up your database. Beware that for the `:avet` index the index needs to be set to true for\nthe attribute `:likes`.\n\n (d/transact db [{:db/ident :name\n :db/type :db.type/string\n :db/cardinality :db.cardinality/one}\n {:db/ident :likes\n :db/type :db.type/string\n :db/index true\n :db/cardinality :db.cardinality/many}\n {:db/ident :friends\n :db/type :db.type/ref\n :db/cardinality :db.cardinality/many}]\n\n (d/transact db [{:db/id 4 :name \"Ivan\"\n {:db/id 4 :likes \"fries\"\n {:db/id 4 :likes \"pizza\"}\n {:db/id 4 :friends 5}])\n\n (d/transact db [{:db/id 5 :name \"Oleg\"}\n {:db/id 5 :likes \"candy\"}\n {:db/id 5 :likes \"pie\"}\n {:db/id 5 :likes \"pizza\"}])\n\nFind all datoms for entity id == 1 (any attrs and values) sort by attribute, then value\n\n (datoms @db {:index :eavt\n :components [1]}) ; => (#datahike/Datom [1 :friends 2]\n ; #datahike/Datom [1 :likes \"fries\"]\n ; #datahike/Datom [1 :likes \"pizza\"]\n ; #datahike/Datom [1 :name \"Ivan\"])\n\nFind all datoms for entity id == 1 and attribute == :likes (any values) sorted by value\n\n (datoms @db {:index :eavt\n :components [1 :likes]}) ; => (#datahike/Datom [1 :likes \"fries\"]\n ; #datahike/Datom [1 :likes \"pizza\"])\n\nFind all datoms for entity id == 1, attribute == :likes and value == \"pizza\"\n\n (datoms @db {:index :eavt\n :components [1 :likes \"pizza\"]}) ; => (#datahike/Datom [1 :likes \"pizza\"])\n\nFind all datoms for attribute == :likes (any entity ids and values) sorted by entity id, then value\n\n (datoms @db {:index :aevt\n :components [:likes]}) ; => (#datahike/Datom [1 :likes \"fries\"]\n ; #datahike/Datom [1 :likes \"pizza\"]\n ; #datahike/Datom [2 :likes \"candy\"]\n ; #datahike/Datom [2 :likes \"pie\"]\n ; #datahike/Datom [2 :likes \"pizza\"])\n\nFind all datoms that have attribute == `:likes` and value == `\"pizza\"` (any entity id)\n`:likes` must be a unique attr, reference or marked as `:db/index true`\n\n (datoms @db {:index :avet\n :components [:likes \"pizza\"]}) ; => (#datahike/Datom [1 :likes \"pizza\"]\n ; #datahike/Datom [2 :likes \"pizza\"])\n\nFind all datoms sorted by entity id, then attribute, then value\n\n (datoms @db {:index :eavt}) ; => (...)\n\n\nUseful patterns:\n\nGet all values of :db.cardinality/many attribute\n\n (->> (datoms @db {:index :eavt\n :components [eid attr]})\n (map :v))\n\nLookup entity ids by attribute value\n\n (->> (datoms @db {:index :avet\n :components [attr value]})\n (map :e))\n\nFind all entities with a specific attribute\n\n (->> (datoms @db {:index :aevt\n :components [attr]})\n (map :e))\n\nFind \u201Csingleton\u201D entity by its attr\n\n (->> (datoms @db {:index :aevt\n :components [attr]})\n first\n :e)\n\nFind N entities with lowest attr value (e.g. 10 earliest posts)\n\n (->> (datoms @db {:index :avet\n :components [attr]})\n (take N))\n\nFind N entities with highest attr value (e.g. 10 latest posts)\n\n (->> (datoms @db {:index :avet\n :components [attr]})\n (reverse)\n (take N))\n\n\nGotchas:\n\n- Index lookup is usually more efficient than doing a query with a single clause.\n- Resulting iterator is calculated in constant time and small constant memory overhead.\n- Iterator supports efficient `first`, `next`, `reverse`, `seq` and is itself a sequence.\n- Will not return datoms that are not part of the index (e.g. attributes with no `:db/index` in schema when querying `:avet` index).\n - `:eavt` and `:aevt` contain all datoms.\n - `:avet` only contains datoms for references, `:db/unique` and `:db/index` attributes.",new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true,new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","datoms","datahike.api.impl/datoms",1820236674,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"txs","txs",2056038378),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70574#","p1__70574#",2084433406,null)], null),cljs.core.list(new cljs.core.Symbol("s","valid?","s/valid?",1428119265,null),new cljs.core.Symbol("spec","STransactionReport","spec/STransactionReport",-392339405,null),cljs.core.list(new cljs.core.Symbol("clojure.core","deref","clojure.core/deref",188719157,null),new cljs.core.Symbol(null,"p1__70574#","p1__70574#",2084433406,null)))),new cljs.core.Keyword(null,"doc","doc",1913296891),"Load entities directly",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.writer","load-entities","datahike.writer/load-entities",1839561346,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"boolean?","boolean?",1790940868,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns `true` if this database was filtered using [[filter]], `false` otherwise.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.core","is-filtered","datahike.core/is-filtered",-904895665,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"argmap","argmap",-6529621),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Symbol("spec","SQueryArgs","spec/SQueryArgs",691919160,null)),new cljs.core.Keyword(null,"with-params","with-params",-468056417),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"q","q",689001697),cljs.core.list(new cljs.core.Symbol("s","or","s/or",1876282981,null),new cljs.core.Keyword(null,"vec","vec",-657847931),new cljs.core.Symbol(null,"vector?","vector?",-61367869,null),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Symbol(null,"map?","map?",-1780568534,null)),new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","*","s/*",345799260,null),new cljs.core.Symbol(null,"any?","any?",-318999933,null)))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true,new cljs.core.Keyword(null,"doc","doc",1913296891),"Executes a datalog query. See [docs.datomic.com/on-prem/query.html](https://docs.datomic.com/on-prem/query.html).\n\nUsage:\n\nQuery as parameter with additional args:\n\n (q '[:find ?value\n :where [_ :likes ?value]]\n #{[1 :likes \"fries\"]\n [2 :likes \"candy\"]\n [3 :likes \"pie\"]\n [4 :likes \"pizza\"]}) ; => #{[\"fries\"] [\"candy\"] [\"pie\"] [\"pizza\"]}\n\nOr query passed in arg-map:\n\n (q {:query '[:find ?value\n :where [_ :likes ?value]]\n :offset 2\n :limit 1\n :args [#{[1 :likes \"fries\"]\n [2 :likes \"candy\"]\n [3 :likes \"pie\"]\n [4 :likes \"pizza\"]}]}) ; => #{[\"fries\"] [\"candy\"] [\"pie\"] [\"pizza\"]}\n\nOr query passed as map of vectors:\n\n (q '{:find [?value] :where [[_ :likes ?value]]}\n #{[1 :likes \"fries\"]\n [2 :likes \"candy\"]\n [3 :likes \"pie\"]\n [4 :likes \"pizza\"]}) ; => #{[\"fries\"] [\"candy\"] [\"pie\"] [\"pizza\"]}\n\nOr query passed as string:\n\n (q {:query \"[:find ?value :where [_ :likes ?value]]\"\n :args [#{[1 :likes \"fries\"]\n [2 :likes \"candy\"]\n [3 :likes \"pie\"]\n [4 :likes \"pizza\"]}]})\n\nQuery passed as map needs vectors as values. Query can not be passed as list. The 1-arity function takes a map with the arguments :query and :args and optionally the additional keys :offset and :limit.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.query","q","datahike.query/q",-469360305,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SSchema","spec/SSchema",227914387,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns current schema definition.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","schema","datahike.api.impl/schema",930520135,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Symbol("spec","SIndexRangeArgs","spec/SIndexRangeArgs",-1933151174,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SDatoms","spec/SDatoms",1451063932,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns part of `:avet` index between `[_ attr start]` and `[_ attr end]` in AVET sort order.\n\nSame properties as [[datoms]].\n\n`attr` must be a reference, unique attribute or marked as `:db/index true`.\n\nUsage:\n\n\n(transact db {:tx-data [{:db/ident :name\n :db/type :db.type/string\n :db/cardinality :db.cardinality/one}\n {:db/ident :likes\n :db/index true\n :db/type :db.type/string\n :db/cardinality :db.cardinality/many}\n {:db/ident :age\n :db/unique :db.unique/identity\n :db/type :db.type/ref\n :db/cardinality :db.cardinality/many}]})\n\n(transact db {:tx-data [{:name \"Ivan\"}\n {:age 19}\n {:likes \"fries\"}\n {:likes \"pizza\"}\n {:likes \"candy\"}\n {:likes \"pie\"}\n {:likes \"pizza\"}]})\n\n(index-range db {:attrid :likes\n :start \"a\"\n :end \"zzzzzzzzz\"}) ; => '(#datahike/Datom [2 :likes \"candy\"]\n ; #datahike/Datom [1 :likes \"fries\"]\n ; #datahike/Datom [2 :likes \"pie\"]\n ; #datahike/Datom [1 :likes \"pizza\"]\n ; #datahike/Datom [2 :likes \"pizza\"])\n\n(index-range db {:attrid :likes\n :start \"egg\"\n :end \"pineapple\"}) ; => '(#datahike/Datom [1 :likes \"fries\"]\n ; #datahike/Datom [2 :likes \"pie\"])\n\nUseful patterns:\n\n ; find all entities with age in a specific range (inclusive)\n (->> (index-range db {:attrid :age :start 18 :end 60}) (map :e))",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","index-range","datahike.api.impl/index-range",-229887738,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"simple","simple",-581868663),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"opts","opts",155075701),new cljs.core.Symbol("spec","SPullOptions","spec/SPullOptions",-1954812912,null)),new cljs.core.Keyword(null,"full","full",436801220),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"selector","selector",762528866),new cljs.core.Symbol(null,"coll?","coll?",-1874821441,null),new cljs.core.Keyword(null,"eid","eid",559519930),new cljs.core.Symbol("spec","SEId","spec/SEId",1986561743,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol("s","coll-of","s/coll-of",-1705285349,null),new cljs.core.Symbol(null,"map?","map?",-1780568534,null)),new cljs.core.Keyword(null,"doc","doc",1913296891),"Same as [[pull]], but accepts sequence of ids and returns sequence of maps.\n\nUsage:\n\n (pull-many db [:db/id :name] [1 2]) ; => [{:db/id 1, :name \"Ivan\"}\n {:db/id 2, :name \"Oleg\"}]",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.pull-api","pull-many","datahike.pull-api/pull-many",1917909172,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"time-point","time-point",-1243116005),new cljs.core.Symbol("spec","time-point?","spec/time-point?",-1126657548,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns the database state since a given point in time (you may use either java.util.Date or a transaction ID as long).\nBe aware: the database contains only the datoms that were added since the date.\n\n\n(transact conn {:tx-data [{:db/ident :name\n :db/valueType :db.type/string\n :db/unique :db.unique/identity\n :db/index true\n :db/cardinality :db.cardinality/one}\n {:db/ident :age\n :db/valueType :db.type/long\n :db/cardinality :db.cardinality/one}]})\n\n(transact conn {:tx-data [{:name \"Alice\" :age 25} {:name \"Bob\" :age 30}]})\n\n(def date (java.util.Date.))\n\n(transact conn [{:db/id [:name \"Alice\"] :age 30}])\n\n(q '[:find ?n ?a\n :in $ $since\n :where\n [$ ?e :name ?n]\n [$since ?e :age ?a]]\n @conn\n (since @conn date)) ; => #{[\"Alice\" 30]}\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [@conn]}) ; => #{[\"Alice\" 30] [\"Bob\" 30]}",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","since","datahike.api.impl/since",1083395660,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"argmap","argmap",-6529621),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Symbol("spec","SQueryArgs","spec/SQueryArgs",691919160,null)),new cljs.core.Keyword(null,"with-params","with-params",-468056417),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"q","q",689001697),cljs.core.list(new cljs.core.Symbol("s","or","s/or",1876282981,null),new cljs.core.Keyword(null,"vec","vec",-657847931),new cljs.core.Symbol(null,"vector?","vector?",-61367869,null),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Symbol(null,"map?","map?",-1780568534,null)),new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","*","s/*",345799260,null),new cljs.core.Symbol(null,"any?","any?",-318999933,null)))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"map?","map?",-1780568534,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true,new cljs.core.Keyword(null,"doc","doc",1913296891),"Executes a datalog query and returns the result as well as some execution details.\nUses the same arguments as q does.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.query","query-stats","datahike.query/query-stats",559403603,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"entity","entity",-450970276),new cljs.core.Symbol("de","entity?","de/entity?",555337042,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns a db that entity was created from.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.impl.entity","entity-db","datahike.impl.entity/entity-db",321018773,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"with-date","with-date",1474070706),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"remove-before","remove-before",2094925881),new cljs.core.Symbol("spec","time-point?","spec/time-point?",-1126657548,null)),new cljs.core.Keyword(null,"no-date","no-date",163104802),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Invokes garbage collection on the store of connection by whitelisting currently known branches.\nAll db snapshots on these branches before remove-before date will also be\nerased (defaults to beginning of time [no erasure]). The branch heads will\nalways be retained. Return the set of removed blobs from the store.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.writer","gc-storage!","datahike.writer/gc-storage!",1698988993,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"config","config",994861415),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"config","config",994861415),new cljs.core.Symbol("spec","SConfig","spec/SConfig",376364196,null),new cljs.core.Keyword(null,"initial-tx","initial-tx",-563178874),cljs.core.list(new cljs.core.Symbol("s","?","s/?",-62633301,null),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"k","k",-2146297393),cljs.core.list(new cljs.core.Symbol("s","?","s/?",-62633301,null),cljs.core.list(new cljs.core.Symbol("s","and","s/and",668634387,null),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70568#","p1__70568#",160269770,null)], null),cljs.core.list(new cljs.core.Symbol(null,"=","=",-1501502141,null),new cljs.core.Symbol(null,"p1__70568#","p1__70568#",160269770,null),new cljs.core.Keyword(null,"initial-tx","initial-tx",-563178874))))),new cljs.core.Keyword(null,"v","v",21465059),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null))),new cljs.core.Keyword(null,"temporal-index","temporal-index",499928198),cljs.core.list(new cljs.core.Symbol("s","?","s/?",-62633301,null),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"k","k",-2146297393),cljs.core.list(new cljs.core.Symbol("s","?","s/?",-62633301,null),cljs.core.list(new cljs.core.Symbol("s","and","s/and",668634387,null),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70570#","p1__70570#",1596496245,null)], null),cljs.core.list(new cljs.core.Symbol(null,"=","=",-1501502141,null),new cljs.core.Symbol(null,"p1__70570#","p1__70570#",1596496245,null),new cljs.core.Keyword(null,"temporal-index","temporal-index",499928198))))),new cljs.core.Keyword(null,"v","v",21465059),new cljs.core.Symbol(null,"boolean?","boolean?",1790940868,null))),new cljs.core.Keyword(null,"schema-on-read","schema-on-read",194957289),cljs.core.list(new cljs.core.Symbol("s","?","s/?",-62633301,null),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"k","k",-2146297393),cljs.core.list(new cljs.core.Symbol("s","?","s/?",-62633301,null),cljs.core.list(new cljs.core.Symbol("s","and","s/and",668634387,null),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70571#","p1__70571#",-126754377,null)], null),cljs.core.list(new cljs.core.Symbol(null,"=","=",-1501502141,null),new cljs.core.Symbol(null,"p1__70571#","p1__70571#",-126754377,null),new cljs.core.Keyword(null,"schema-on-read","schema-on-read",194957289))))),new cljs.core.Keyword(null,"v","v",21465059),new cljs.core.Symbol(null,"boolean?","boolean?",1790940868,null)))),new cljs.core.Keyword(null,"nil","nil",99600501),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70572#","p1__70572#",2081905526,null)], null),cljs.core.list(new cljs.core.Symbol("s","valid?","s/valid?",1428119265,null),new cljs.core.Symbol("spec","SConfig","spec/SConfig",376364196,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70572#","p1__70572#",2081905526,null)], null))),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"doc","doc",1913296891),"Creates a database via configuration map. For more information on the configuration refer to the [docs](https://github.com/replikativ/datahike/blob/master/doc/config.md).\n\nThe configuration is a hash-map with keys: `:store`, `:initial-tx`, `:keep-history?`, `:schema-flexibility`, `:index`\n\n- `:store` defines the backend configuration as hash-map with mandatory key: `:backend` and store dependent keys.\nPer default Datahike ships with `:memory` and `:file` backend.\n- `:initial-tx` defines the first transaction into the database, often setting default data like the schema.\n- `:keep-history?` is a boolean that toggles whether Datahike keeps historical data.\n- `:schema-flexibility` can be set to either `:read` or `:write` setting the validation method for the data.\n- `:read` validates the data when your read data from the database, `:write` validates the data when you transact new data.\n- `:index` defines the data type of the index. Available are `:datahike.index/hitchhiker-tree`, `:datahike.index/persistent-set` (only available with in-memory storage)\n- `:name` defines your database name optionally, if not set, a random name is created\n- `:writer` optionally configures a writer as a hash map. If not set, the default local writer is used.\n\nDefault configuration has in-memory store, keeps history with write schema flexibility, and has no initial transaction:\n`{:store {:backend :memory :id \"default\"} :keep-history? true :schema-flexibility :write}`\n\nUsage:\n\n ;; create an empty database:\n (create-database {:store {:backend :memory :id \"example\"} :name \"my-favourite-database\"})\n\n ;; Datahike has a strict schema validation (schema-flexibility `:write`) policy by default, that only allows transaction of data that has been pre-defined by a schema.\n ;; You may influence this behaviour using the `:schema-flexibility` attribute:\n (create-database {:store {:backend :memory :id \"example\"} :schema-flexibility :read})\n\n ;; By writing historical data in a separate index, datahike has the capability of querying data from any point in time.\n ;; You may control this feature using the `:keep-history?` attribute:\n (create-database {:store {:backend :memory :id \"example\"} :keep-history? false})\n\n ;; Initial data after creation may be added using the `:initial-tx` attribute, which in this example adds a schema:\n (create-database {:store {:backend :memory :id \"example\"} :initial-tx [{:db/ident :name :db/valueType :db.type/string :db.cardinality/one}]})",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","create-database","datahike.api.impl/create-database",53542506,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns the underlying immutable database value from a connection.\n\nExists for Datomic API compatibility. Prefer using `@conn` directly if possible.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","db","datahike.api.impl/db",1358486675,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"config","config",994861415),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"config","config",994861415),new cljs.core.Symbol("spec","SConfig","spec/SConfig",376364196,null)),new cljs.core.Keyword(null,"config+opts","config+opts",1635779982),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"config","config",994861415),new cljs.core.Symbol("spec","SConfig","spec/SConfig",376364196,null),new cljs.core.Keyword(null,"opts","opts",155075701),new cljs.core.Symbol(null,"map?","map?",-1780568534,null)),new cljs.core.Keyword(null,"nil","nil",99600501),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"doc","doc",1913296891),"Connects to a datahike database via configuration map. For more information on the configuration refer to the [docs](https://github.com/replikativ/datahike/blob/master/doc/config.md).\n\nThe configuration for a connection is a subset of the Datahike configuration with only the store necessary: `:store`.\n\n`:store` defines the backend configuration as hash-map with mandatory key: `:backend` and store dependent keys.\n\nPer default Datahike ships with `:memory` and `:file` backend.\n\nThe default configuration:\n`{:store {:backend :memory :id \"default\"}}`\n\nUsage:\n\nConnect to default in-memory configuration:\n`(connect)`\n\nConnect to a database with persistent store:\n`(connect {:store {:backend :file :path \"/tmp/example\"}})`",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.connector","connect","datahike.connector/connect",-1126227188,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"nil?","nil?",1612038930,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Releases a database connection. You need to release a connection as many times as you connected to it for it to be completely released. Set release-all? to true to force its release.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.connector","release","datahike.connector/release",281485710,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"coll?","coll?",-1874821441,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true,new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns the full historical state of the database you may interact with.\n\n\n(transact conn {:tx-data [{:db/ident :name\n :db/valueType :db.type/string\n :db/unique :db.unique/identity\n :db/index true\n :db/cardinality :db.cardinality/one}\n {:db/ident :age\n :db/valueType :db.type/long\n :db/cardinality :db.cardinality/one}]})\n\n(transact conn {:tx-data [{:name \"Alice\" :age 25} {:name \"Bob\" :age 30}]})\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [(history @conn)]}) ; => #{[\"Alice\" 25] [\"Bob\" 30]}\n\n(transact conn {:tx-data [{:db/id [:name \"Alice\"] :age 35}]})\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [@conn]}) ; => #{[\"Alice\" 35] [\"Bob\" 30]}\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [(history @conn)]}) ; => #{[\"Alice\" 25] [\"Bob\" 30]}",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","history","datahike.api.impl/history",789392182,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"txs","txs",2056038378),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70573#","p1__70573#",1506372267,null)], null),cljs.core.list(new cljs.core.Symbol("s","valid?","s/valid?",1428119265,null),new cljs.core.Symbol("spec","STransactionReport","spec/STransactionReport",-392339405,null),cljs.core.list(new cljs.core.Symbol("clojure.core","deref","clojure.core/deref",188719157,null),new cljs.core.Symbol(null,"p1__70573#","p1__70573#",1506372267,null)))),new cljs.core.Keyword(null,"doc","doc",1913296891),"Same as transact, but asynchronously returns a future.",new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","transact!","datahike.api.impl/transact!",1689923864,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"config","config",994861415),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"config","config",994861415),new cljs.core.Symbol("spec","SConfig","spec/SConfig",376364196,null)),new cljs.core.Keyword(null,"nil","nil",99600501),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"boolean?","boolean?",1790940868,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"doc","doc",1913296891),"Checks if a database exists via configuration map.\nUsage:\n\n (database-exists? {:store {:backend :memory :id \"example\"}})",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","database-exists?","datahike.api.impl/database-exists?",-320395216,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"txs","txs",2056038378),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","STransactionReport","spec/STransactionReport",-392339405,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false,new cljs.core.Keyword(null,"doc","doc",1913296891),"Applies transaction to the underlying database value and atomically updates the connection reference to point to the result of that transaction, the new db value.\n\nAccepts the connection and a map, vector or sequence as argument, specifying the transaction data.\n\nReturns transaction report, a map:\n\n {:db-before ... ; db value before transaction\n :db-after ... ; db value after transaction\n :tx-data [...] ; plain datoms that were added/retracted from db-before\n :tempids {...} ; map of tempid from tx-data => assigned entid in db-after\n :tx-meta tx-meta } ; the exact value you passed as `tx-meta`\n\nNote! `conn` will be updated in-place and is not returned from [[transact]].\n\nUsage:\n\n ;; add a single datom to an existing entity (1)\n (transact conn [[:db/add 1 :name \"Ivan\"]])\n\n ;; retract a single datom\n (transact conn [[:db/retract 1 :name \"Ivan\"]])\n\n ;; retract single entity attribute\n (transact conn [[:db.fn/retractAttribute 1 :name]])\n\n ;; retract all entity attributes (effectively deletes entity)\n (transact conn [[:db.fn/retractEntity 1]])\n\n ;; create a new entity (`-1`, as any other negative value, is a tempid\n ;; that will be replaced by Datahike with the next unused eid)\n (transact conn [[:db/add -1 :name \"Ivan\"]])\n\n ;; check assigned id (here `*1` is a result returned from previous `transact` call)\n (def report *1)\n (:tempids report) ; => {-1 296, :db/current-tx 536870913}\n\n ;; check actual datoms inserted\n (:tx-data report) ; => [#datahike/Datom [296 :name \"Ivan\" 536870913]]\n\n ;; tempid can also be a string\n (transact conn [[:db/add \"ivan\" :name \"Ivan\"]])\n (:tempids *1) ; => {\"ivan\" 5, :db/current-tx 536870920}\n\n ;; reference another entity (must exist)\n (transact conn [[:db/add -1 :friend 296]])\n\n ;; create an entity and set multiple attributes (in a single transaction\n ;; equal tempids will be replaced with the same unused yet entid)\n (transact conn [[:db/add -1 :name \"Ivan\"]\n [:db/add -1 :likes \"fries\"]\n [:db/add -1 :likes \"pizza\"]\n [:db/add -1 :friend 296]])\n\n ;; create an entity and set multiple attributes (alternative map form)\n (transact conn [{:db/id -1\n :name \"Ivan\"\n :likes [\"fries\" \"pizza\"]\n :friend 296}])\n\n ;; update an entity (alternative map form). Can\u2019t retract attributes in\n ;; map form. For cardinality many attrs, value (fish in this example)\n ;; will be added to the list of existing values\n (transact conn [{:db/id 296\n :name \"Oleg\"\n :likes [\"fish\"]}])\n\n ;; ref attributes can be specified as nested map, that will create a nested entity as well\n (transact conn [{:db/id -1\n :name \"Oleg\"\n :friend {:db/id -2\n :name \"Sergey\"}}])\n\n ;; schema is needed for using a reverse attribute\n (is (transact conn [{:db/valueType :db.type/ref\n :db/cardinality :db.cardinality/one\n :db/ident :friend}]))\n\n ;; reverse attribute name can be used if you want a created entity to become\n ;; a value in another entity reference\n (transact conn [{:db/id -1\n :name \"Oleg\"\n :_friend 296}])\n ;; equivalent to\n (transact conn [[:db/add -1 :name \"Oleg\"]\n [:db/add 296 :friend -1]])",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","transact","datahike.api.impl/transact",-2049685258,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"time-point","time-point",-1243116005),new cljs.core.Symbol("spec","time-point?","spec/time-point?",-1126657548,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns the database state at given point in time (you may use either java.util.Date or transaction ID as long).\n\n(transact conn {:tx-data [{:db/ident :name\n :db/valueType :db.type/string\n :db/unique :db.unique/identity\n :db/index true\n :db/cardinality :db.cardinality/one}\n {:db/ident :age\n :db/valueType :db.type/long\n :db/cardinality :db.cardinality/one}]})\n\n(transact conn {:tx-data [{:name \"Alice\" :age 25} {:name \"Bob\" :age 30}]})\n\n(def date (java.util.Date.))\n\n(transact conn {:tx-data [{:db/id [:name \"Alice\"] :age 35}]})\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [(as-of @conn date)]}) ; => #{[\"Alice\" 25] [\"Bob\" 30]}\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [@conn]}) ; => #{[\"Alice\" 35] [\"Bob\" 30]}",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","as-of","datahike.api.impl/as-of",-1879338698,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"map","map",1371690461),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Symbol("spec","SIndexLookupArgs","spec/SIndexLookupArgs",-203316249,null)),new cljs.core.Keyword(null,"key","key",-1516042587),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"index","index",-1531685915),new cljs.core.Symbol(null,"keyword?","keyword?",1917797069,null),new cljs.core.Keyword(null,"components","components",-1073188942),cljs.core.list(new cljs.core.Symbol("s","*","s/*",345799260,null),new cljs.core.Symbol(null,"any?","any?",-318999933,null)))),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol("s","nilable","s/nilable",-812128520,null),new cljs.core.Symbol("spec","SDatoms","spec/SDatoms",1451063932,null)),new cljs.core.Keyword(null,"doc","doc",1913296891),"Similar to [[datoms]], but will return datoms starting from specified components and including rest of the database until the end of the index.\n\n If no datom matches passed arguments exactly, iterator will start from first datom that could be considered \u201Cgreater\u201D in index order.\n\n Usage:\n\n (seek-datoms @db {:index :eavt\n :components [1]}) ; => (#datahike/Datom [1 :friends 2]\n ; #datahike/Datom [1 :likes \"fries\"]\n ; #datahike/Datom [1 :likes \"pizza\"]\n ; #datahike/Datom [1 :name \"Ivan\"]\n ; #datahike/Datom [2 :likes \"candy\"]\n ; #datahike/Datom [2 :likes \"pie\"]\n ; #datahike/Datom [2 :likes \"pizza\"])\n\n (seek-datoms @db {:index :eavt\n :components [1 :name]}) ; => (#datahike/Datom [1 :name \"Ivan\"]\n ; #datahike/Datom [2 :likes \"candy\"]\n ; #datahike/Datom [2 :likes \"pie\"]\n ; #datahike/Datom [2 :likes \"pizza\"])\n\n (seek-datoms @db {:index :eavt\n :components [2]}) ; => (#datahike/Datom [2 :likes \"candy\"]\n ; #datahike/Datom [2 :likes \"pie\"]\n ; #datahike/Datom [2 :likes \"pizza\"])\n\n No datom `[2 :likes \"fish\"]`, so starts with one immediately following such in index\n\n (seek-datoms @db {:index :eavt\n :components [2 :likes \"fish\"]}) ; => (#datahike/Datom [2 :likes \"pie\"]\n ; #datahike/Datom [2 :likes \"pizza\"])",new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),true,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true,new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","seek-datoms","datahike.api.impl/seek-datoms",1730527932,null)], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"pred","pred",1927423397),new cljs.core.Symbol(null,"any?","any?",-318999933,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70596#","p1__70596#",-1043968330,null)], null),cljs.core.list(new cljs.core.Symbol(null,"is-filtered","is-filtered",230239847,null),new cljs.core.Symbol(null,"p1__70596#","p1__70596#",-1043968330,null))),new cljs.core.Keyword(null,"doc","doc",1913296891),"Returns a view over database that has same interface but only includes datoms for which the `(pred db datom)` is true. Can be applied multiple times.\n\nFiltered DB gotchas:\n\n- All operations on filtered database are proxied to original DB, then filter pred is applied.\n- Not cached. You pay filter penalty every time.\n- Supports entities, pull, queries, index access.\n- Does not support hashing of DB.\n- Does not support [[with]] and [[db-with]].",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.core","filter","datahike.core/filter",-393982767,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"no-key","no-key",-466291118),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"callback","callback",-705136228),new cljs.core.Symbol(null,"fn?","fn?",1820990818,null)),new cljs.core.Keyword(null,"with-key","with-key",-137452603),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"conn","conn",278309663),new cljs.core.Symbol("spec","SConnection","spec/SConnection",616044262,null),new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"callback","callback",-705136228),new cljs.core.Symbol(null,"fn?","fn?",1820990818,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"fn","fn",-1175266204),cljs.core.list(new cljs.core.Symbol(null,"fn*","fn*",-752876845,null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"p1__70597#","p1__70597#",1961456409,null)], null),cljs.core.list(new cljs.core.Symbol(null,"if","if",1181717262,null),cljs.core.list(new cljs.core.Symbol(null,"=","=",-1501502141,null),new cljs.core.Keyword(null,"with-key","with-key",-137452603),cljs.core.list(new cljs.core.Symbol(null,"->","->",-2139605430,null),new cljs.core.Symbol(null,"p1__70597#","p1__70597#",1961456409,null),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Symbol(null,"first","first",996428481,null))),cljs.core.list(new cljs.core.Symbol(null,"=","=",-1501502141,null),cljs.core.list(new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"p1__70597#","p1__70597#",1961456409,null)),cljs.core.list(new cljs.core.Symbol(null,"->","->",-2139605430,null),new cljs.core.Symbol(null,"p1__70597#","p1__70597#",1961456409,null),new cljs.core.Keyword(null,"args","args",1315556576),new cljs.core.Symbol(null,"second","second",1195829517,null),new cljs.core.Keyword(null,"key","key",-1516042587))),true)),new cljs.core.Keyword(null,"doc","doc",1913296891),"Listen for changes on the given connection. Whenever a transaction is applied to the database via\n[[transact]], the callback is called with the transaction report. `key` is any opaque unique value.\n\nIdempotent. Calling [[listen]] with the same twice will override old callback with the new value.\n\nReturns the key under which this listener is registered. See also [[unlisten]].",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.core","listen!","datahike.core/listen!",-1182319526,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),false], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"tx-data","tx-data",934159761),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null)),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Applies transaction to an immutable db value, returning new immutable db value. Same as `(:db-after (with db tx-data))`.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","db-with","datahike.api.impl/db-with",-1042123457,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"with-map","with-map",1513193935),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"argmap","argmap",-6529621),new cljs.core.Symbol("spec","SWithArgs","spec/SWithArgs",780936164,null)),new cljs.core.Keyword(null,"with-data","with-data",-1106621804),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"tx-data","tx-data",934159761),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null)),new cljs.core.Keyword(null,"with-meta","with-meta",-1566856820),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"db","db",993250759),new cljs.core.Symbol("spec","SDB","spec/SDB",90196423,null),new cljs.core.Keyword(null,"tx-data","tx-data",934159761),new cljs.core.Symbol("spec","STransactions","spec/STransactions",-1405123897,null),new cljs.core.Keyword(null,"tx-meta","tx-meta",1159283194),new cljs.core.Symbol("spec","STxMeta","spec/STxMeta",-86494456,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol("spec","STransactionReport","spec/STransactionReport",-392339405,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Same as [[transact]]`, but applies to an immutable database value. Returns transaction report (see [[transact]]).\n\n Accepts tx-data and tx-meta as a map.\n\n (with @conn {:tx-data [[:db/add 1 :name \"Ivan\"]]}) ; => {:db-before #datahike/DB {:max-tx 536870912 :max-eid 0},\n ; :db-after #datahike/DB {:max-tx 536870913 :max-eid 1},\n ; :tx-data [#datahike/Datom [1 :name \"Ivan\" 536870913]],\n ; :tempids #:db{:current-tx 536870913},\n ; :tx-meta nil}\n\n (with @conn {:tx-data [[:db/add 1 :name \"Ivan\"]]\n :tx-meta {:foo :bar}}) ; => {:db-before #datahike/DB {:max-tx 536870912 :max-eid 0},\n ; :db-after #datahike/DB {:max-tx 536870913 :max-eid 1},\n ; :tx-data [#datahike/Datom [1 :name \"Ivan\" 536870913]],\n ; :tempids #:db{:current-tx 536870913},\n ; :tx-meta {:foo :bar}}",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.api.impl","with","datahike.api.impl/with",1915942424,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"args","args",1315556576),cljs.core.list(new cljs.core.Symbol("s","alt","s/alt",1637316720,null),new cljs.core.Keyword(null,"part","part",77757738),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"full","full",436801220),cljs.core.list(new cljs.core.Symbol("s","cat","s/cat",182721371,null),new cljs.core.Keyword(null,"part","part",77757738),new cljs.core.Symbol(null,"any?","any?",-318999933,null),new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Symbol(null,"int?","int?",1799729645,null))),new cljs.core.Keyword(null,"ret","ret",-468222814),new cljs.core.Symbol(null,"neg-int?","neg-int?",-1610409390,null),new cljs.core.Keyword(null,"doc","doc",1913296891),"Allocates and returns a unique temporary id (a negative integer). Ignores `part`. Returns `x` if it is specified.\n\nExists for Datomic API compatibility. Prefer using negative integers directly if possible.",new cljs.core.Keyword(null,"impl","impl",1677848700),new cljs.core.Symbol("datahike.core","tempid","datahike.core/tempid",1988047573,null),new cljs.core.Keyword(null,"supports-remote?","supports-remote?",-1678671785),false,new cljs.core.Keyword(null,"referentially-transparent?","referentially-transparent?",1850376986),true], null)]);
84
+
85
+ //# sourceMappingURL=datahike.api.specification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["datahike/api/specification.cljc"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;sCAAA,tCAAMA,oFAEHC;AAFH,AAGE,iEAAA,IAAA,9DAAU,4CAAKA;;AAEjB;;;oDAAA,pDAAMC,gHAEHC;AAFH,AAGE,GAAA,GAAQ,AAACC,qBAAKD;AACZ,GAAI,6CAAA,7CAACE,8FAAOF;AAAZ;;AAAA,0FAAmB,AAACG,+CAAO,AAACC,eAAKJ;;;AACjC,IAAAK,aAAkBL;IAAlBM,aAAA,AAAAC,cAAAF;IAAAG,eAAA,AAAAC,gBAAAH;IAAAA,iBAAA,AAAAI,eAAAJ;SAAAE,LAAOG;WAAPL,PAAYM;AAAZ,AACE,GACE,gDAAA,AAAA,hDAACV,6CAAES;AADL,0FAEG,AAACE,cAAI,AAACC,sDAAO,WAAAC;AAAA,AAAA,IAAAC,aAAAD;QAAA,AAAAE,4CAAAD,WAAA,IAAA,/DAAME;QAAN,AAAAD,4CAAAD,WAAA,IAAA,/DAAQG;AAAR,AACE,GAAI,EAAK,AAAClB,qBAAKkB,QAAG,gEAAA,AAAA,hEAACjB,6CAAE,AAACO,gBAAMU;AAC1B,OAACN,cAAI,+CAAA,mFAAA,AAAA,lIAACO,8LAAY,CAACrB,kFAAAA,qFAAAA,LAAoBmB,kEAAAA;;AACvC,QAACnB,kFAAAA,qFAAAA,LAAoBmB,kEAAAA;;qDACzB,kDAAA,lDAACG,sDAAYT;;AAN7B,GAQE,gDAAA,AAAA,hDAACV,6CAAES;AACH,OAACE,cAAI,AAACC,sDAAO,WAAAQ;AAAA,AAAA,IAAAC,aAAAD;QAAA,AAAAL,4CAAAM,WAAA,IAAA,/DAAML;QAAN,AAAAD,4CAAAM,WAAA,IAAA,/DAAQJ;AAAR,AACE,GAAI,AAAClB,qBAAKkB;AACR,QAACpB,kFAAAA,qFAAAA,LAAoBoB,kEAAAA;;AADvB,0FAAA,mFAEI,AAAChB,+CAAO,AAACC,eAAKc;;qDACpB,kDAAA,lDAACG,sDAAYT;;AAb5B,AAAA;;;;;;AAiBN,+CAAA,AAAA,/CAAKY","names":["datahike.api.specification/->url","name","datahike.api.specification/spec-args->argslist","s","cljs.core/seq?","cljs.core._EQ_","cljs.core.symbol","cljs.core/name","vec__70555","seq__70556","cljs.core/seq","first__70557","cljs.core/first","cljs.core/next","op","args","cljs.core/vec","cljs.core.mapcat","p__70558","vec__70561","cljs.core.nth","k","v","cljs.core.concat","cljs.core.partition","p__70564","vec__70565","datahike.api.specification/api-specification"],"sourcesContent":["(ns datahike.api.specification\n \"Shared specification for different bindings. This namespace holds all\n information such that individual bindings can be automatically derived from\n it.\"\n (:require [clojure.spec.alpha :as s]\n [datahike.spec :as spec]))\n\n(defn ->url\n \"Turns an API endpoint name into a URL.\"\n [name]\n (.replace (str name) \"?\" \"\"))\n\n(defn spec-args->argslist\n \"This function is a helper to translate a spec into a list of arguments. It is only complete enough to deal with the specs in this namespace.\"\n [s]\n (if-not (seq? s)\n (if (= :nil s) [] [(symbol (name s))])\n (let [[op & args] s]\n (cond\n (= op 's/cat)\n [(vec (mapcat (fn [[k v]]\n (if (and (seq? v) (= (first v) 's/*))\n (vec (concat ['&] (spec-args->argslist k)))\n (spec-args->argslist k)))\n (partition 2 args)))]\n\n (= op 's/alt)\n (vec (mapcat (fn [[k v]]\n (if (seq? v)\n (spec-args->argslist v)\n [[(symbol (name k))]]))\n (partition 2 args)))\n :else\n []))))\n\n(def api-specification\n '{database-exists?\n {:args (s/alt :config (s/cat :config spec/SConfig)\n :nil (s/cat))\n :ret boolean?\n :supports-remote? true\n :referentially-transparent? false\n :doc\n \"Checks if a database exists via configuration map.\nUsage:\n\n (database-exists? {:store {:backend :memory :id \\\"example\\\"}})\"\n :impl datahike.api.impl/database-exists?}\n\n create-database\n {:args (s/alt :config\n (s/cat :config spec/SConfig\n :initial-tx (s/? (s/cat :k (s/? (s/and #(= % :initial-tx))) :v spec/STransactions))\n :temporal-index (s/? (s/cat :k (s/? (s/and #(= % :temporal-index))) :v boolean?))\n :schema-on-read (s/? (s/cat :k (s/? (s/and #(= % :schema-on-read))) :v boolean?)))\n :nil (s/cat))\n :ret #(s/valid? spec/SConfig [%])\n :supports-remote? true\n :referentially-transparent? false\n :doc\n \"Creates a database via configuration map. For more information on the configuration refer to the [docs](https://github.com/replikativ/datahike/blob/master/doc/config.md).\n\nThe configuration is a hash-map with keys: `:store`, `:initial-tx`, `:keep-history?`, `:schema-flexibility`, `:index`\n\n- `:store` defines the backend configuration as hash-map with mandatory key: `:backend` and store dependent keys.\nPer default Datahike ships with `:memory` and `:file` backend.\n- `:initial-tx` defines the first transaction into the database, often setting default data like the schema.\n- `:keep-history?` is a boolean that toggles whether Datahike keeps historical data.\n- `:schema-flexibility` can be set to either `:read` or `:write` setting the validation method for the data.\n- `:read` validates the data when your read data from the database, `:write` validates the data when you transact new data.\n- `:index` defines the data type of the index. Available are `:datahike.index/hitchhiker-tree`, `:datahike.index/persistent-set` (only available with in-memory storage)\n- `:name` defines your database name optionally, if not set, a random name is created\n- `:writer` optionally configures a writer as a hash map. If not set, the default local writer is used.\n\nDefault configuration has in-memory store, keeps history with write schema flexibility, and has no initial transaction:\n`{:store {:backend :memory :id \\\"default\\\"} :keep-history? true :schema-flexibility :write}`\n\nUsage:\n\n ;; create an empty database:\n (create-database {:store {:backend :memory :id \\\"example\\\"} :name \\\"my-favourite-database\\\"})\n\n ;; Datahike has a strict schema validation (schema-flexibility `:write`) policy by default, that only allows transaction of data that has been pre-defined by a schema.\n ;; You may influence this behaviour using the `:schema-flexibility` attribute:\n (create-database {:store {:backend :memory :id \\\"example\\\"} :schema-flexibility :read})\n\n ;; By writing historical data in a separate index, datahike has the capability of querying data from any point in time.\n ;; You may control this feature using the `:keep-history?` attribute:\n (create-database {:store {:backend :memory :id \\\"example\\\"} :keep-history? false})\n\n ;; Initial data after creation may be added using the `:initial-tx` attribute, which in this example adds a schema:\n (create-database {:store {:backend :memory :id \\\"example\\\"} :initial-tx [{:db/ident :name :db/valueType :db.type/string :db.cardinality/one}]})\"\n :impl datahike.api.impl/create-database}\n\n delete-database\n {:args (s/alt :config (s/cat :config spec/SConfig)\n :nil (s/cat))\n :ret any?\n :supports-remote? true\n :referentially-transparent? false\n :doc \"Deletes a database given via configuration map. Storage configuration `:store` is mandatory.\nFor more information refer to the [docs](https://github.com/replikativ/datahike/blob/master/doc/config.md)\"\n :impl datahike.api.impl/delete-database}\n\n connect\n {:args (s/alt :config (s/cat :config spec/SConfig)\n :config+opts (s/cat :config spec/SConfig :opts map?)\n :nil (s/cat))\n :ret spec/SConnection\n :supports-remote? true\n :referentially-transparent? false\n :doc \"Connects to a datahike database via configuration map. For more information on the configuration refer to the [docs](https://github.com/replikativ/datahike/blob/master/doc/config.md).\n\nThe configuration for a connection is a subset of the Datahike configuration with only the store necessary: `:store`.\n\n`:store` defines the backend configuration as hash-map with mandatory key: `:backend` and store dependent keys.\n\nPer default Datahike ships with `:memory` and `:file` backend.\n\nThe default configuration:\n`{:store {:backend :memory :id \\\"default\\\"}}`\n\nUsage:\n\nConnect to default in-memory configuration:\n`(connect)`\n\nConnect to a database with persistent store:\n`(connect {:store {:backend :file :path \\\"/tmp/example\\\"}})`\"\n :impl datahike.connector/connect}\n\n db\n {:args (s/cat :conn spec/SConnection)\n :ret spec/SDB\n :supports-remote? true\n :referentially-transparent? false\n :doc \"Returns the underlying immutable database value from a connection.\n\nExists for Datomic API compatibility. Prefer using `@conn` directly if possible.\"\n :impl datahike.api.impl/db}\n\n transact!\n {:args (s/cat :conn spec/SConnection :txs spec/STransactions)\n :ret #(s/valid? spec/STransactionReport @%)\n :doc \"Same as transact, but asynchronously returns a future.\"\n :supports-remote? false\n :referentially-transparent? false\n :impl datahike.api.impl/transact!}\n\n transact\n {:args (s/cat :conn spec/SConnection :txs spec/STransactions)\n :ret spec/STransactionReport\n :supports-remote? true\n :referentially-transparent? false\n :doc\n \"Applies transaction to the underlying database value and atomically updates the connection reference to point to the result of that transaction, the new db value.\n\nAccepts the connection and a map, vector or sequence as argument, specifying the transaction data.\n\nReturns transaction report, a map:\n\n {:db-before ... ; db value before transaction\n :db-after ... ; db value after transaction\n :tx-data [...] ; plain datoms that were added/retracted from db-before\n :tempids {...} ; map of tempid from tx-data => assigned entid in db-after\n :tx-meta tx-meta } ; the exact value you passed as `tx-meta`\n\nNote! `conn` will be updated in-place and is not returned from [[transact]].\n\nUsage:\n\n ;; add a single datom to an existing entity (1)\n (transact conn [[:db/add 1 :name \\\"Ivan\\\"]])\n\n ;; retract a single datom\n (transact conn [[:db/retract 1 :name \\\"Ivan\\\"]])\n\n ;; retract single entity attribute\n (transact conn [[:db.fn/retractAttribute 1 :name]])\n\n ;; retract all entity attributes (effectively deletes entity)\n (transact conn [[:db.fn/retractEntity 1]])\n\n ;; create a new entity (`-1`, as any other negative value, is a tempid\n ;; that will be replaced by Datahike with the next unused eid)\n (transact conn [[:db/add -1 :name \\\"Ivan\\\"]])\n\n ;; check assigned id (here `*1` is a result returned from previous `transact` call)\n (def report *1)\n (:tempids report) ; => {-1 296, :db/current-tx 536870913}\n\n ;; check actual datoms inserted\n (:tx-data report) ; => [#datahike/Datom [296 :name \\\"Ivan\\\" 536870913]]\n\n ;; tempid can also be a string\n (transact conn [[:db/add \\\"ivan\\\" :name \\\"Ivan\\\"]])\n (:tempids *1) ; => {\\\"ivan\\\" 5, :db/current-tx 536870920}\n\n ;; reference another entity (must exist)\n (transact conn [[:db/add -1 :friend 296]])\n\n ;; create an entity and set multiple attributes (in a single transaction\n ;; equal tempids will be replaced with the same unused yet entid)\n (transact conn [[:db/add -1 :name \\\"Ivan\\\"]\n [:db/add -1 :likes \\\"fries\\\"]\n [:db/add -1 :likes \\\"pizza\\\"]\n [:db/add -1 :friend 296]])\n\n ;; create an entity and set multiple attributes (alternative map form)\n (transact conn [{:db/id -1\n :name \\\"Ivan\\\"\n :likes [\\\"fries\\\" \\\"pizza\\\"]\n :friend 296}])\n\n ;; update an entity (alternative map form). Can\u2019t retract attributes in\n ;; map form. For cardinality many attrs, value (fish in this example)\n ;; will be added to the list of existing values\n (transact conn [{:db/id 296\n :name \\\"Oleg\\\"\n :likes [\\\"fish\\\"]}])\n\n ;; ref attributes can be specified as nested map, that will create a nested entity as well\n (transact conn [{:db/id -1\n :name \\\"Oleg\\\"\n :friend {:db/id -2\n :name \\\"Sergey\\\"}}])\n\n ;; schema is needed for using a reverse attribute\n (is (transact conn [{:db/valueType :db.type/ref\n :db/cardinality :db.cardinality/one\n :db/ident :friend}]))\n\n ;; reverse attribute name can be used if you want a created entity to become\n ;; a value in another entity reference\n (transact conn [{:db/id -1\n :name \\\"Oleg\\\"\n :_friend 296}])\n ;; equivalent to\n (transact conn [[:db/add -1 :name \\\"Oleg\\\"]\n [:db/add 296 :friend -1]])\"\n :impl datahike.api.impl/transact}\n\n q\n {:args (s/alt :argmap (s/cat :map spec/SQueryArgs)\n :with-params (s/cat :q (s/or :vec vector? :map map?) :args (s/* any?)))\n :ret any?\n :supports-remote? true\n :referentially-transparent? true\n :doc\n \"Executes a datalog query. See [docs.datomic.com/on-prem/query.html](https://docs.datomic.com/on-prem/query.html).\n\nUsage:\n\nQuery as parameter with additional args:\n\n (q '[:find ?value\n :where [_ :likes ?value]]\n #{[1 :likes \\\"fries\\\"]\n [2 :likes \\\"candy\\\"]\n [3 :likes \\\"pie\\\"]\n [4 :likes \\\"pizza\\\"]}) ; => #{[\\\"fries\\\"] [\\\"candy\\\"] [\\\"pie\\\"] [\\\"pizza\\\"]}\n\nOr query passed in arg-map:\n\n (q {:query '[:find ?value\n :where [_ :likes ?value]]\n :offset 2\n :limit 1\n :args [#{[1 :likes \\\"fries\\\"]\n [2 :likes \\\"candy\\\"]\n [3 :likes \\\"pie\\\"]\n [4 :likes \\\"pizza\\\"]}]}) ; => #{[\\\"fries\\\"] [\\\"candy\\\"] [\\\"pie\\\"] [\\\"pizza\\\"]}\n\nOr query passed as map of vectors:\n\n (q '{:find [?value] :where [[_ :likes ?value]]}\n #{[1 :likes \\\"fries\\\"]\n [2 :likes \\\"candy\\\"]\n [3 :likes \\\"pie\\\"]\n [4 :likes \\\"pizza\\\"]}) ; => #{[\\\"fries\\\"] [\\\"candy\\\"] [\\\"pie\\\"] [\\\"pizza\\\"]}\n\nOr query passed as string:\n\n (q {:query \\\"[:find ?value :where [_ :likes ?value]]\\\"\n :args [#{[1 :likes \\\"fries\\\"]\n [2 :likes \\\"candy\\\"]\n [3 :likes \\\"pie\\\"]\n [4 :likes \\\"pizza\\\"]}]})\n\nQuery passed as map needs vectors as values. Query can not be passed as list. The 1-arity function takes a map with the arguments :query and :args and optionally the additional keys :offset and :limit.\"\n :impl datahike.query/q}\n\n load-entities\n {:args (s/cat :conn spec/SConnection :txs spec/STransactions)\n :ret #(s/valid? spec/STransactionReport @%)\n :doc \"Load entities directly\"\n :impl datahike.writer/load-entities\n :supports-remote? true\n :referentially-transparent? false}\n\n release\n {:args (s/cat :conn spec/SConnection)\n :ret nil?\n :doc \"Releases a database connection. You need to release a connection as many times as you connected to it for it to be completely released. Set release-all? to true to force its release.\"\n :impl datahike.connector/release\n :supports-remote? true\n :referentially-transparent? false}\n\n pull\n {:args (s/alt :simple (s/cat :db spec/SDB :opts spec/SPullOptions)\n :full (s/cat :db spec/SDB :selector coll? :eid spec/SEId))\n :ret (s/nilable map?)\n :doc\n \"Fetches data from database using recursive declarative description. See [docs.datomic.com/on-prem/pull.html](https://docs.datomic.com/on-prem/pull.html).\n\nUnlike [[entity]], returns plain Clojure map (not lazy).\n\nUsage:\n\n (pull db [:db/id, :name, :likes, {:friends [:db/id :name]}] 1) ; => {:db/id 1,\n :name \\\"Ivan\\\"\n :likes [:pizza]\n :friends [{:db/id 2, :name \\\"Oleg\\\"}]}\n\nThe arity-2 version takes :selector and :eid in arg-map.\"\n :impl datahike.pull-api/pull\n :supports-remote? true\n :referentially-transparent? true}\n\n pull-many\n {:args (s/alt :simple (s/cat :db spec/SDB :opts spec/SPullOptions)\n :full (s/cat :db spec/SDB :selector coll? :eid spec/SEId))\n :ret (s/coll-of map?)\n :doc\n \"Same as [[pull]], but accepts sequence of ids and returns sequence of maps.\n\nUsage:\n\n (pull-many db [:db/id :name] [1 2]) ; => [{:db/id 1, :name \\\"Ivan\\\"}\n {:db/id 2, :name \\\"Oleg\\\"}]\"\n :impl datahike.pull-api/pull-many\n :supports-remote? true\n :referentially-transparent? true}\n\n query-stats\n {:args (s/alt :argmap (s/cat :map spec/SQueryArgs)\n :with-params (s/cat :q (s/or :vec vector? :map map?) :args (s/* any?))) ;; TODO: the doc could show more examples with varargs\n :ret map?\n :supports-remote? true\n :referentially-transparent? true\n :doc \"Executes a datalog query and returns the result as well as some execution details.\nUses the same arguments as q does.\"\n :impl datahike.query/query-stats}\n\n datoms\n {:args (s/alt :map (s/cat :db spec/SDB :args spec/SIndexLookupArgs)\n :key (s/cat :db spec/SDB :index keyword? :components (s/alt :coll (s/* any?)\n :nil nil?)))\n :ret (s/nilable spec/SDatoms)\n :doc\n \"Index lookup. Returns a sequence of datoms (lazy iterator over actual DB index) which components\n(e, a, v) match passed arguments. Datoms are sorted in index sort order. Possible `index` values\nare: `:eavt`, `:aevt`, `:avet`.\n\nAccepts db and a map as arguments with the keys `:index` and `:components` provided within the\nmap, or the arguments provided separately.\n\n\nUsage:\n\nSet up your database. Beware that for the `:avet` index the index needs to be set to true for\nthe attribute `:likes`.\n\n (d/transact db [{:db/ident :name\n :db/type :db.type/string\n :db/cardinality :db.cardinality/one}\n {:db/ident :likes\n :db/type :db.type/string\n :db/index true\n :db/cardinality :db.cardinality/many}\n {:db/ident :friends\n :db/type :db.type/ref\n :db/cardinality :db.cardinality/many}]\n\n (d/transact db [{:db/id 4 :name \\\"Ivan\\\"\n {:db/id 4 :likes \\\"fries\\\"\n {:db/id 4 :likes \\\"pizza\\\"}\n {:db/id 4 :friends 5}])\n\n (d/transact db [{:db/id 5 :name \\\"Oleg\\\"}\n {:db/id 5 :likes \\\"candy\\\"}\n {:db/id 5 :likes \\\"pie\\\"}\n {:db/id 5 :likes \\\"pizza\\\"}])\n\nFind all datoms for entity id == 1 (any attrs and values) sort by attribute, then value\n\n (datoms @db {:index :eavt\n :components [1]}) ; => (#datahike/Datom [1 :friends 2]\n ; #datahike/Datom [1 :likes \\\"fries\\\"]\n ; #datahike/Datom [1 :likes \\\"pizza\\\"]\n ; #datahike/Datom [1 :name \\\"Ivan\\\"])\n\nFind all datoms for entity id == 1 and attribute == :likes (any values) sorted by value\n\n (datoms @db {:index :eavt\n :components [1 :likes]}) ; => (#datahike/Datom [1 :likes \\\"fries\\\"]\n ; #datahike/Datom [1 :likes \\\"pizza\\\"])\n\nFind all datoms for entity id == 1, attribute == :likes and value == \\\"pizza\\\"\n\n (datoms @db {:index :eavt\n :components [1 :likes \\\"pizza\\\"]}) ; => (#datahike/Datom [1 :likes \\\"pizza\\\"])\n\nFind all datoms for attribute == :likes (any entity ids and values) sorted by entity id, then value\n\n (datoms @db {:index :aevt\n :components [:likes]}) ; => (#datahike/Datom [1 :likes \\\"fries\\\"]\n ; #datahike/Datom [1 :likes \\\"pizza\\\"]\n ; #datahike/Datom [2 :likes \\\"candy\\\"]\n ; #datahike/Datom [2 :likes \\\"pie\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\n\nFind all datoms that have attribute == `:likes` and value == `\\\"pizza\\\"` (any entity id)\n`:likes` must be a unique attr, reference or marked as `:db/index true`\n\n (datoms @db {:index :avet\n :components [:likes \\\"pizza\\\"]}) ; => (#datahike/Datom [1 :likes \\\"pizza\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\n\nFind all datoms sorted by entity id, then attribute, then value\n\n (datoms @db {:index :eavt}) ; => (...)\n\n\nUseful patterns:\n\nGet all values of :db.cardinality/many attribute\n\n (->> (datoms @db {:index :eavt\n :components [eid attr]})\n (map :v))\n\nLookup entity ids by attribute value\n\n (->> (datoms @db {:index :avet\n :components [attr value]})\n (map :e))\n\nFind all entities with a specific attribute\n\n (->> (datoms @db {:index :aevt\n :components [attr]})\n (map :e))\n\nFind \u201csingleton\u201d entity by its attr\n\n (->> (datoms @db {:index :aevt\n :components [attr]})\n first\n :e)\n\nFind N entities with lowest attr value (e.g. 10 earliest posts)\n\n (->> (datoms @db {:index :avet\n :components [attr]})\n (take N))\n\nFind N entities with highest attr value (e.g. 10 latest posts)\n\n (->> (datoms @db {:index :avet\n :components [attr]})\n (reverse)\n (take N))\n\n\nGotchas:\n\n- Index lookup is usually more efficient than doing a query with a single clause.\n- Resulting iterator is calculated in constant time and small constant memory overhead.\n- Iterator supports efficient `first`, `next`, `reverse`, `seq` and is itself a sequence.\n- Will not return datoms that are not part of the index (e.g. attributes with no `:db/index` in schema when querying `:avet` index).\n - `:eavt` and `:aevt` contain all datoms.\n - `:avet` only contains datoms for references, `:db/unique` and `:db/index` attributes.\"\n :supports-remote? true\n :referentially-transparent? true\n :impl datahike.api.impl/datoms}\n\n seek-datoms\n {:args (s/alt :map (s/cat :db spec/SDB :args spec/SIndexLookupArgs)\n :key (s/cat :db spec/SDB :index keyword? :components (s/* any?)))\n :ret (s/nilable spec/SDatoms)\n :doc \"Similar to [[datoms]], but will return datoms starting from specified components and including rest of the database until the end of the index.\n\n If no datom matches passed arguments exactly, iterator will start from first datom that could be considered \u201cgreater\u201d in index order.\n\n Usage:\n\n (seek-datoms @db {:index :eavt\n :components [1]}) ; => (#datahike/Datom [1 :friends 2]\n ; #datahike/Datom [1 :likes \\\"fries\\\"]\n ; #datahike/Datom [1 :likes \\\"pizza\\\"]\n ; #datahike/Datom [1 :name \\\"Ivan\\\"]\n ; #datahike/Datom [2 :likes \\\"candy\\\"]\n ; #datahike/Datom [2 :likes \\\"pie\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\n\n (seek-datoms @db {:index :eavt\n :components [1 :name]}) ; => (#datahike/Datom [1 :name \\\"Ivan\\\"]\n ; #datahike/Datom [2 :likes \\\"candy\\\"]\n ; #datahike/Datom [2 :likes \\\"pie\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\n\n (seek-datoms @db {:index :eavt\n :components [2]}) ; => (#datahike/Datom [2 :likes \\\"candy\\\"]\n ; #datahike/Datom [2 :likes \\\"pie\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\n\n No datom `[2 :likes \\\"fish\\\"]`, so starts with one immediately following such in index\n\n (seek-datoms @db {:index :eavt\n :components [2 :likes \\\"fish\\\"]}) ; => (#datahike/Datom [2 :likes \\\"pie\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\"\n :supports-remote? true\n :referentially-transparent? true\n :impl datahike.api.impl/seek-datoms}\n\n index-range\n {:args (s/cat :db spec/SDB :args spec/SIndexRangeArgs)\n :ret spec/SDatoms\n :doc\n \"Returns part of `:avet` index between `[_ attr start]` and `[_ attr end]` in AVET sort order.\n\nSame properties as [[datoms]].\n\n`attr` must be a reference, unique attribute or marked as `:db/index true`.\n\nUsage:\n\n\n(transact db {:tx-data [{:db/ident :name\n :db/type :db.type/string\n :db/cardinality :db.cardinality/one}\n {:db/ident :likes\n :db/index true\n :db/type :db.type/string\n :db/cardinality :db.cardinality/many}\n {:db/ident :age\n :db/unique :db.unique/identity\n :db/type :db.type/ref\n :db/cardinality :db.cardinality/many}]})\n\n(transact db {:tx-data [{:name \\\"Ivan\\\"}\n {:age 19}\n {:likes \\\"fries\\\"}\n {:likes \\\"pizza\\\"}\n {:likes \\\"candy\\\"}\n {:likes \\\"pie\\\"}\n {:likes \\\"pizza\\\"}]})\n\n(index-range db {:attrid :likes\n :start \\\"a\\\"\n :end \\\"zzzzzzzzz\\\"}) ; => '(#datahike/Datom [2 :likes \\\"candy\\\"]\n ; #datahike/Datom [1 :likes \\\"fries\\\"]\n ; #datahike/Datom [2 :likes \\\"pie\\\"]\n ; #datahike/Datom [1 :likes \\\"pizza\\\"]\n ; #datahike/Datom [2 :likes \\\"pizza\\\"])\n\n(index-range db {:attrid :likes\n :start \\\"egg\\\"\n :end \\\"pineapple\\\"}) ; => '(#datahike/Datom [1 :likes \\\"fries\\\"]\n ; #datahike/Datom [2 :likes \\\"pie\\\"])\n\nUseful patterns:\n\n ; find all entities with age in a specific range (inclusive)\n (->> (index-range db {:attrid :age :start 18 :end 60}) (map :e))\"\n :impl datahike.api.impl/index-range\n :supports-remote? true\n :referentially-transparent? true}\n\n tempid\n {:args (s/alt :part any? :full (s/cat :part any? :x int?))\n :ret neg-int?\n :doc \"Allocates and returns a unique temporary id (a negative integer). Ignores `part`. Returns `x` if it is specified.\n\nExists for Datomic API compatibility. Prefer using negative integers directly if possible.\"\n :impl datahike.core/tempid\n :supports-remote? false\n :referentially-transparent? true}\n\n entity\n {:args (s/cat :db spec/SDB :eid (s/alt :eid spec/SEId :div any?))\n :ret (s/nilable de/entity?)\n :doc \"Retrieves an entity by its id from database. Entities are lazy map-like structures to navigate Datahike database content.\n\nFor `eid` pass entity id or lookup attr:\n\n (entity db 1)\n (entity db [:unique-attr :value])\n\nIf entity does not exist, `nil` is returned:\n\n (entity db -1) ; => nil\n\nCreating an entity by id is very cheap, almost no-op, as attr access is on-demand:\n\n (entity db 1) ; => {:db/id 1}\n\nEntity attributes can be lazily accessed through key lookups:\n\n (:attr (entity db 1)) ; => :value\n (get (entity db 1) :attr) ; => :value\n\nCardinality many attributes are returned sequences:\n\n (:attrs (entity db 1)) ; => [:v1 :v2 :v3]\n\nReference attributes are returned as another entities:\n\n (:ref (entity db 1)) ; => {:db/id 2}\n (:ns/ref (entity db 1)) ; => {:db/id 2}\n\nReferences can be walked backwards by prepending `_` to name part of an attribute:\n\n (:_ref (entity db 2)) ; => [{:db/id 1}]\n (:ns/_ref (entity db 2)) ; => [{:db/id 1}]\n\nReverse reference lookup returns sequence of entities unless attribute is marked as `:db/component`:\n\n (:_component-ref (entity db 2)) ; => {:db/id 1}\n\nEntity gotchas:\n\n- Entities print as map, but are not exactly maps (they have compatible get interface though).\n- Entities are effectively immutable \u201cviews\u201d into a particular version of a database.\n- Entities retain reference to the whole database.\n- You can't change database through entities, only read.\n- Creating an entity by id is very cheap, almost no-op (attributes are looked up on demand).\n- Comparing entities just compares their ids. Be careful when comparing entities taken from different dbs or from different versions of the same db.\n- Accessed entity attributes are cached on entity itself (except backward references).\n- When printing, only cached attributes (the ones you have accessed before) are printed. See [[touch]].\"\n :impl datahike.impl.entity/entity\n :supports-remote? true\n :referentially-transparent? true}\n\n entity-db\n {:args (s/cat :entity de/entity?)\n :ret spec/SDB\n :doc \"Returns a db that entity was created from.\"\n :impl datahike.impl.entity/entity-db\n :supports-remote? true\n :referentially-transparent? true}\n\n is-filtered\n {:args (s/cat :db spec/SDB)\n :ret boolean?\n :doc \"Returns `true` if this database was filtered using [[filter]], `false` otherwise.\"\n :impl datahike.core/is-filtered\n :supports-remote? false\n :referentially-transparent? true}\n\n filter\n {:args (s/cat :db spec/SDB :pred any?)\n :ret #(is-filtered %)\n :doc \"Returns a view over database that has same interface but only includes datoms for which the `(pred db datom)` is true. Can be applied multiple times.\n\nFiltered DB gotchas:\n\n- All operations on filtered database are proxied to original DB, then filter pred is applied.\n- Not cached. You pay filter penalty every time.\n- Supports entities, pull, queries, index access.\n- Does not support hashing of DB.\n- Does not support [[with]] and [[db-with]].\"\n :impl datahike.core/filter\n :supports-remote? false\n :referentially-transparent? true}\n\n with\n {:args (s/alt :with-map (s/cat :db spec/SDB :argmap spec/SWithArgs)\n :with-data (s/cat :db spec/SDB :tx-data spec/STransactions)\n :with-meta (s/cat :db spec/SDB :tx-data spec/STransactions :tx-meta spec/STxMeta))\n :ret spec/STransactionReport\n :doc \"Same as [[transact]]`, but applies to an immutable database value. Returns transaction report (see [[transact]]).\n\n Accepts tx-data and tx-meta as a map.\n\n (with @conn {:tx-data [[:db/add 1 :name \\\"Ivan\\\"]]}) ; => {:db-before #datahike/DB {:max-tx 536870912 :max-eid 0},\n ; :db-after #datahike/DB {:max-tx 536870913 :max-eid 1},\n ; :tx-data [#datahike/Datom [1 :name \\\"Ivan\\\" 536870913]],\n ; :tempids #:db{:current-tx 536870913},\n ; :tx-meta nil}\n\n (with @conn {:tx-data [[:db/add 1 :name \\\"Ivan\\\"]]\n :tx-meta {:foo :bar}}) ; => {:db-before #datahike/DB {:max-tx 536870912 :max-eid 0},\n ; :db-after #datahike/DB {:max-tx 536870913 :max-eid 1},\n ; :tx-data [#datahike/Datom [1 :name \\\"Ivan\\\" 536870913]],\n ; :tempids #:db{:current-tx 536870913},\n ; :tx-meta {:foo :bar}}\"\n :impl datahike.api.impl/with\n :supports-remote? false\n :referentially-transparent? true}\n\n db-with\n {:args (s/cat :db spec/SDB :tx-data spec/STransactions)\n :ret spec/SDB\n :doc \"Applies transaction to an immutable db value, returning new immutable db value. Same as `(:db-after (with db tx-data))`.\"\n :impl datahike.api.impl/db-with\n :supports-remote? false\n :referentially-transparent? true}\n\n history\n {:args (s/cat :db spec/SDB)\n :ret coll?\n :supports-remote? true\n :referentially-transparent? true\n :doc\n \"Returns the full historical state of the database you may interact with.\n\n\n(transact conn {:tx-data [{:db/ident :name\n :db/valueType :db.type/string\n :db/unique :db.unique/identity\n :db/index true\n :db/cardinality :db.cardinality/one}\n {:db/ident :age\n :db/valueType :db.type/long\n :db/cardinality :db.cardinality/one}]})\n\n(transact conn {:tx-data [{:name \\\"Alice\\\" :age 25} {:name \\\"Bob\\\" :age 30}]})\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [(history @conn)]}) ; => #{[\\\"Alice\\\" 25] [\\\"Bob\\\" 30]}\n\n(transact conn {:tx-data [{:db/id [:name \\\"Alice\\\"] :age 35}]})\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [@conn]}) ; => #{[\\\"Alice\\\" 35] [\\\"Bob\\\" 30]}\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [(history @conn)]}) ; => #{[\\\"Alice\\\" 25] [\\\"Bob\\\" 30]}\"\n :impl datahike.api.impl/history}\n\n since\n {:args (s/cat :db spec/SDB :time-point spec/time-point?)\n :ret spec/SDB\n :doc \"Returns the database state since a given point in time (you may use either java.util.Date or a transaction ID as long).\nBe aware: the database contains only the datoms that were added since the date.\n\n\n(transact conn {:tx-data [{:db/ident :name\n :db/valueType :db.type/string\n :db/unique :db.unique/identity\n :db/index true\n :db/cardinality :db.cardinality/one}\n {:db/ident :age\n :db/valueType :db.type/long\n :db/cardinality :db.cardinality/one}]})\n\n(transact conn {:tx-data [{:name \\\"Alice\\\" :age 25} {:name \\\"Bob\\\" :age 30}]})\n\n(def date (java.util.Date.))\n\n(transact conn [{:db/id [:name \\\"Alice\\\"] :age 30}])\n\n(q '[:find ?n ?a\n :in $ $since\n :where\n [$ ?e :name ?n]\n [$since ?e :age ?a]]\n @conn\n (since @conn date)) ; => #{[\\\"Alice\\\" 30]}\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [@conn]}) ; => #{[\\\"Alice\\\" 30] [\\\"Bob\\\" 30]}\"\n :impl datahike.api.impl/since\n :supports-remote? true\n :referentially-transparent? true}\n\n as-of\n {:args (s/cat :db spec/SDB :time-point spec/time-point?)\n :ret spec/SDB\n :doc \"Returns the database state at given point in time (you may use either java.util.Date or transaction ID as long).\n\n(transact conn {:tx-data [{:db/ident :name\n :db/valueType :db.type/string\n :db/unique :db.unique/identity\n :db/index true\n :db/cardinality :db.cardinality/one}\n {:db/ident :age\n :db/valueType :db.type/long\n :db/cardinality :db.cardinality/one}]})\n\n(transact conn {:tx-data [{:name \\\"Alice\\\" :age 25} {:name \\\"Bob\\\" :age 30}]})\n\n(def date (java.util.Date.))\n\n(transact conn {:tx-data [{:db/id [:name \\\"Alice\\\"] :age 35}]})\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [(as-of @conn date)]}) ; => #{[\\\"Alice\\\" 25] [\\\"Bob\\\" 30]}\n\n(q {:query '[:find ?n ?a :where [?e :name ?n] [?e :age ?a]]\n :args [@conn]}) ; => #{[\\\"Alice\\\" 35] [\\\"Bob\\\" 30]}\"\n :impl datahike.api.impl/as-of\n :supports-remote? true\n :referentially-transparent? true}\n\n listen\n {:args (s/alt :no-key (s/cat :conn spec/SConnection :callback fn?)\n :with-key (s/cat :conn spec/SConnection :key any? :callback fn?))\n :ret any?\n :fn #(if (= :with-key (-> % :args first))\n (= (:ret %) (-> % :args second :key))\n true)\n :doc\n \"Listen for changes on the given connection. Whenever a transaction is applied to the database via\n[[transact]], the callback is called with the transaction report. `key` is any opaque unique value.\n\nIdempotent. Calling [[listen]] with the same twice will override old callback with the new value.\n\nReturns the key under which this listener is registered. See also [[unlisten]].\"\n :impl datahike.core/listen!\n :supports-remote? false\n :referentially-transparent? false}\n\n unlisten\n {:args (s/cat :conn spec/SConnection :key any?)\n :ret map?\n :doc \"Removes registered listener from connection. See also [[listen]].\"\n :impl datahike.core/unlisten!\n :supports-remote? false\n :referentially-transparent? false}\n\n schema\n {:args (s/cat :db spec/SDB)\n :ret spec/SSchema\n :doc \"Returns current schema definition.\"\n :impl datahike.api.impl/schema\n :supports-remote? true\n :referentially-transparent? true}\n\n reverse-schema\n {:args (s/cat :db spec/SDB)\n :ret map?\n :doc \"Returns current reverse schema definition.\"\n :impl datahike.api.impl/reverse-schema\n :supports-remote? true\n :referentially-transparent? true}\n\n metrics\n {:args (s/cat :db spec/SDB)\n :ret spec/SMetrics\n :doc \"Returns database metrics.\"\n :impl datahike.db/metrics\n :supports-remote? true\n :referentially-transparent? true}\n\n gc-storage\n {:args (s/alt :with-date (s/cat :conn spec/SConnection :remove-before spec/time-point?)\n :no-date (s/cat :conn spec/SConnection))\n :ret any?\n :doc \"Invokes garbage collection on the store of connection by whitelisting currently known branches.\nAll db snapshots on these branches before remove-before date will also be\nerased (defaults to beginning of time [no erasure]). The branch heads will\nalways be retained. Return the set of removed blobs from the store.\"\n :impl datahike.writer/gc-storage!\n :supports-remote? true\n :referentially-transparent? false}})\n"]}