Module Datascript.Conn

type t
type creation_context = {
  1. empty_db : ?schema:schema -> ?storage:storage -> unit -> db;
  2. init_db : ?schema:schema -> ?storage:storage -> datom list -> db;
  3. store : ?storage:storage -> db -> db;
}
type schema_context = {
  1. store : ?storage:storage -> db -> db;
  2. with_schema : db -> schema -> db;
}
type restore_context = {
  1. restore : storage -> db option;
  2. restore_tail_groups : storage -> datom list list;
}
type transact_context = {
  1. store : ?storage:storage -> db -> db;
  2. store_tail : storage -> datom list list -> unit;
  3. storage_tail_datom_count : datom list list -> int;
  4. storage_tail_compaction_threshold : db -> int;
  5. transact : tx_meta:tx_meta -> db -> tx_op list -> tx_report;
}
type reset_context = {
  1. store : ?storage:storage -> db -> db;
  2. datoms : db -> datom list;
}
val create : creation_context -> ?schema:schema -> ?storage:storage -> unit -> t
val from_db : creation_context -> db -> t
val from_datoms : creation_context -> ?schema:schema -> ?storage:storage -> datom list -> t
val db : t -> db
val update_db : t -> (db -> db) -> unit
val storage_tail : t -> datom list list
val is_conn : t -> bool
val listen : t -> string -> (tx_report -> unit) -> string
val listen_auto : t -> (tx_report -> unit) -> string
val unlisten : t -> string -> unit
val reset_schema : schema_context -> t -> schema -> db
val restore : restore_context -> storage -> t option
val transact : transact_context -> ?tx_meta:tx_meta -> t -> tx_op list -> tx_report
val reset : reset_context -> ?tx_meta:tx_meta -> t -> db -> db