Module Datascript

include module type of Datascript_types
type entity_id = int
type attr = string
type tx = int
type entity_ref =
  1. | Entity_id of entity_id
  2. | Temp_id of string
  3. | CurrentTx
  4. | Ident of string
  5. | Lookup_ref of attr * value
and value =
  1. | Nil
  2. | Int64 of int64
  3. | Float of float
  4. | String of string
  5. | Symbol of string
  6. | Bool of bool
  7. | Keyword of string
  8. | Uuid of string
  9. | Instant of int64
  10. | Regex of string
  11. | Ref of entity_id
  12. | List of value list
  13. | Vector of value list
  14. | Map of (value * value) list
  15. | Set of value list
  16. | Tuple of value option list
  17. | TxRef
  18. | Ref_to of entity_ref
type cardinality =
  1. | One
  2. | Many
type unique =
  1. | Value
  2. | Identity
type value_type =
  1. | RefType
  2. | TupleType
  3. | StringType
  4. | KeywordType
  5. | NumberType
  6. | UuidType
  7. | InstantType
type schema_attr = {
  1. cardinality : cardinality;
  2. unique : unique option;
  3. indexed : bool;
  4. is_component : bool;
  5. no_history : bool;
  6. doc : string option;
  7. value_type : value_type option;
  8. tuple_attrs : attr list option;
  9. tuple_types : value_type list option;
}
type schema = (attr * schema_attr) list
type datom = {
  1. e : entity_id;
  2. a : attr;
  3. v : value;
  4. tx : tx;
  5. added : bool;
}
type serializable_db = {
  1. serializable_schema : schema;
  2. serializable_datoms : datom list;
  3. serializable_max_eid : entity_id;
  4. serializable_max_tx : tx;
}
type storage_address = string
type storage_index_metadata = {
  1. storage_index_count : int;
  2. storage_index_shift : int;
}
type storage_root = {
  1. storage_schema : schema;
  2. storage_schema_idents : (entity_id * attr) list;
  3. storage_max_eid : entity_id;
  4. storage_max_tx : tx;
  5. storage_eavt : storage_address;
  6. storage_aevt : storage_address;
  7. storage_avet : storage_address;
  8. storage_eavt_metadata : storage_index_metadata option;
  9. storage_aevt_metadata : storage_index_metadata option;
  10. storage_avet_metadata : storage_index_metadata option;
  11. storage_duplicate_datoms : datom list;
  12. storage_max_addr : int;
  13. storage_branching_factor : int;
  14. storage_ref_type : Persistent_sorted_set.ref_type;
}
type storage_payload =
  1. | Storage_root of storage_root
  2. | Storage_node of datom Persistent_sorted_set.stored_node
  3. | Storage_tail of datom list list
type storage = {
  1. storage_store : (storage_address * storage_payload) list -> unit;
  2. storage_restore : storage_address -> storage_payload option;
  3. storage_list_addresses : unit -> storage_address list;
  4. storage_delete : storage_address list -> unit;
}
type tx_value =
  1. | One_value of value
  2. | Many_values of value list
  3. | One_entity of tx_entity
  4. | Many_entities of tx_entity list
and tx_entity = {
  1. db_id : entity_ref option;
  2. attrs : (attr * tx_value) list;
}
type tx_op =
  1. | Add of entity_ref * attr * value
  2. | Retract of entity_ref * attr * value option
  3. | RetractEntity of entity_ref
  4. | RetractAttr of entity_ref * attr
  5. | CompareAndSet of entity_ref * attr * value option * value
  6. | Entity of tx_entity
  7. | Raw_datom of datom
  8. | InstallTxFn of entity_ref * db -> value list -> tx_op list
  9. | CallIdent of entity_ref * value list
  10. | Call of db -> tx_op list
and db = {
  1. db_uid : int;
  2. schema : schema;
  3. eavt_index : datom Persistent_sorted_set.t;
  4. aevt_index : datom Persistent_sorted_set.t;
  5. avet_index : datom Persistent_sorted_set.t;
  6. aevt_by_attr : (attr, datom list) Stdlib.Hashtbl.t;
  7. avet_by_attr : (attr, datom list) Stdlib.Hashtbl.t;
  8. duplicate_datoms : datom list;
  9. duplicate_aevt_datoms : datom list;
  10. duplicate_avet_datoms : datom list;
  11. duplicate_eavt_by_entity : (entity_id, datom list) Stdlib.Hashtbl.t;
  12. duplicate_aevt_by_attr : (attr, datom list) Stdlib.Hashtbl.t;
  13. duplicate_avet_by_attr : (attr, datom list) Stdlib.Hashtbl.t;
  14. max_eid : entity_id;
  15. max_datom_e : entity_id;
  16. max_tx : tx;
  17. filter_pred : (datom -> bool) option;
  18. storage_ref : storage option;
  19. tx_fns : (entity_id * (db -> value list -> tx_op list)) list;
}
type entity = {
  1. id : entity_id;
  2. db : db;
  3. attrs : (attr * tx_value) list;
  4. lookup_attr : attr -> tx_value option;
  5. materialize_attrs : unit -> (attr * tx_value) list;
}
type pulled_entity = {
  1. pulled_id : entity_id;
  2. pulled_attrs : (pull_key * pulled_value) list;
}
and pull_key = value
and pulled_value =
  1. | Pulled_scalar of value
  2. | Pulled_many of pulled_value list
  3. | Pulled_entity of pulled_entity
type pull_visit =
  1. | PullVisitAttr of entity_id * attr
  2. | PullVisitWildcard of entity_id
  3. | PullVisitReverse of attr * entity_id
type pull_selector =
  1. | Pull_id
  2. | Pull_wildcard
  3. | Pull_attr of attr
  4. | Pull_attr_default of attr * value
  5. | Pull_attr_limit of attr * int
  6. | Pull_attr_unlimited of attr
  7. | Pull_attr_xform of attr * pulled_value -> pulled_value
  8. | Pull_attr_default_xform of attr * value * pulled_value -> pulled_value
  9. | Pull_ref of attr * pull_selector list
  10. | Pull_ref_default of attr * pull_selector list * value
  11. | Pull_ref_limit of attr * pull_selector list * int
  12. | Pull_ref_unlimited of attr * pull_selector list
  13. | Pull_ref_xform of attr * pull_selector list * pulled_value -> pulled_value
  14. | Pull_recursive_ref of attr * pull_selector list * int option
  15. | Pull_reverse_ref of attr * pull_selector list
  16. | Pull_reverse_ref_default of attr * pull_selector list * value
  17. | Pull_reverse_ref_limit of attr * pull_selector list * int
  18. | Pull_reverse_ref_unlimited of attr * pull_selector list
  19. | Pull_reverse_ref_xform of attr * pull_selector list * pulled_value -> pulled_value
  20. | Pull_as of pull_selector * pull_key
type query_term =
  1. | QVar of string
  2. | QEntity of entity_id
  3. | QIdent of string
  4. | QLookupRef of attr * value
  5. | QAttr of attr
  6. | QValue of value
  7. | QSource of string
  8. | QWildcard
type query_result =
  1. | Result_entity of entity_id
  2. | Result_attr of attr
  3. | Result_value of value
  4. | Result_db of db
  5. | Result_pull of pulled_entity
type query_source =
  1. | Db_source of db
  2. | Relation_source of query_result list list
type value_predicate =
  1. | NumberValue
  2. | IntegerValue
  3. | StringValue
  4. | BooleanValue
  5. | KeywordValue
type numeric_predicate =
  1. | ZeroNumber
  2. | PositiveNumber
  3. | NegativeNumber
  4. | EvenInteger
  5. | OddInteger
type comparison_predicate =
  1. | LessThan
  2. | GreaterThan
  3. | LessOrEqual
  4. | GreaterOrEqual
type equality_predicate =
  1. | EqualValues
  2. | NotEqualValues
type arithmetic_op =
  1. | AddNumbers
  2. | SubtractNumbers
  3. | MultiplyNumbers
  4. | DivideNumbers
  5. | IncrementNumber
  6. | DecrementNumber
  7. | QuotientNumbers
  8. | RemainderNumbers
  9. | ModuloNumbers
type extremum_op =
  1. | MinimumValue
  2. | MaximumValue
type boolean_predicate =
  1. | TrueValue
  2. | FalseValue
  3. | NilValue
  4. | SomeValue
type query_clause =
  1. | Pattern of query_term * query_term * query_term
  2. | PatternTx of query_term * query_term * query_term * query_term
  3. | PatternTxOp of query_term * query_term * query_term * query_term * query_term
  4. | SourcePattern of string * query_term * query_term * query_term
  5. | SourcePatternTx of string * query_term * query_term * query_term * query_term
  6. | SourcePatternTxOp of string * query_term * query_term * query_term * query_term * query_term
  7. | SourceRelationPattern of string * query_term list
  8. | Missing of query_term * query_term
  9. | SourceMissing of string * query_term * query_term
  10. | GetElse of query_term * query_term * query_term * string
  11. | SourceGetElse of string * query_term * query_term * query_term * string
  12. | GetSome of query_term * query_term list * string * string
  13. | SourceGetSome of string * query_term * query_term list * string * string
  14. | GetValue of query_term * query_term * string
  15. | GetDefaultValue of query_term * query_term * query_term * string
  16. | CountValue of query_term * string
  17. | EmptyValue of query_term
  18. | NotEmptyValue of query_term
  19. | ContainsValue of query_term * query_term
  20. | ValuePredicate of value_predicate * query_term
  21. | NumericPredicate of numeric_predicate * query_term
  22. | ComparisonPredicate of comparison_predicate * query_term * query_term
  23. | ComparisonPredicateN of comparison_predicate * query_term list
  24. | EqualityPredicate of equality_predicate * query_term list
  25. | ArithmeticValue of arithmetic_op * query_term list * string
  26. | CompareValue of query_term * query_term * string
  27. | ExtremumValue of extremum_op * query_term list * string
  28. | BooleanPredicate of boolean_predicate * query_term
  29. | BooleanNotPredicate of query_term
  30. | BooleanNotValue of query_term * string
  31. | IdentityValue of query_term * string
  32. | BooleanAndPredicate of query_term list
  33. | BooleanAndValue of query_term list * string
  34. | BooleanOrPredicate of query_term list
  35. | BooleanOrValue of query_term list * string
  36. | RandomValue of string
  37. | RandomIntValue of query_term * string
  38. | DifferPredicate of query_term list
  39. | IdenticalPredicate of query_term * query_term
  40. | TypeValue of query_term * string
  41. | MetaValue of query_term * string
  42. | NameValue of query_term * string
  43. | NamespaceValue of query_term * string
  44. | KeywordFromName of query_term * string
  45. | KeywordFromNamespaceName of query_term * query_term * string
  46. | StringIncludesValue of query_term * query_term
  47. | StringStartsWithValue of query_term * query_term
  48. | StringEndsWithValue of query_term * query_term
  49. | StringLowerCaseValue of query_term * string
  50. | StringUpperCaseValue of query_term * string
  51. | StringCapitalizeValue of query_term * string
  52. | StringReverseValue of query_term * string
  53. | StringTrimValue of query_term * string
  54. | StringTrimLeftValue of query_term * string
  55. | StringTrimRightValue of query_term * string
  56. | StringTrimNewlineValue of query_term * string
  57. | StringIndexOfValue of query_term * query_term * string
  58. | StringLastIndexOfValue of query_term * query_term * string
  59. | StringSubstringValue of query_term * query_term * query_term option * string
  60. | StringBuildValue of query_term list * string
  61. | PrintStringValue of query_term list * string
  62. | PrintLineStringValue of query_term list * string
  63. | PrStringValue of query_term list * string
  64. | PrnStringValue of query_term list * string
  65. | StringJoinPlainValue of query_term * string
  66. | StringJoinValue of query_term * query_term * string
  67. | StringReplaceValue of query_term * query_term * query_term * string
  68. | StringReplaceFirstValue of query_term * query_term * query_term * string
  69. | StringEscapeValue of query_term * query_term * string
  70. | RePatternValue of query_term * string
  71. | ReFindValue of query_term * query_term * string
  72. | ReMatchesValue of query_term * query_term * string
  73. | ReSeqValue of query_term * query_term * string
  74. | ReFindPredicate of query_term * query_term
  75. | ReMatchesPredicate of query_term * query_term
  76. | StringBlankValue of query_term
  77. | StringSplitValue of query_term * query_term * string
  78. | StringSplitLimitValue of query_term * query_term * query_term * string
  79. | StringSplitLinesValue of query_term * string
  80. | Ground of value * string
  81. | GroundCollection of value list * string
  82. | GroundTuple of value list * string list
  83. | GroundRelation of value list list * string list
  84. | GroundTerm of query_term * string
  85. | GroundTermCollection of query_term * string
  86. | GroundTermTuple of query_term * string list
  87. | GroundTermRelation of query_term * string list
  88. | VectorValue of query_term list * string
  89. | ListValue of query_term list * string
  90. | SetValue of query_term list * string
  91. | HashMapValue of query_term list * string
  92. | ArrayMapValue of query_term list * string
  93. | RangeEndValue of query_term * string
  94. | RangeValue of query_term * query_term * string
  95. | RangeStepValue of query_term * query_term * query_term * string
  96. | TupleFunction of query_term list * string
  97. | UntupleFunction of query_term * string list
  98. | Predicate of string * query_term list * query_result list -> bool
  99. | Function of string * query_term list * string list * query_result list -> query_result list option
  100. | DynamicPredicate of string * query_term list
  101. | DynamicFunction of string * query_term list * string list
  102. | DynamicFunctionCollection of string * query_term list * string
  103. | DynamicFunctionRelation of string * query_term list * string list
  104. | SourceClause of string * query_clause
  105. | Not of query_clause list
  106. | SourceNot of string * query_clause list
  107. | NotJoin of string list * query_clause list
  108. | SourceNotJoin of string * string list * query_clause list
  109. | Or of query_clause list list
  110. | SourceOr of string * query_clause list list
  111. | OrJoin of string list * query_clause list list
  112. | SourceOrJoin of string * string list * query_clause list list
  113. | OrJoinRequired of string list * string list * query_clause list list
  114. | SourceOrJoinRequired of string * string list * string list * query_clause list list
  115. | Rule of string * query_term list
  116. | SourceRule of string * string * query_term list
type query_rule = {
  1. rule_name : string;
  2. rule_params : string list;
  3. rule_body : query_clause list;
}
type input_binding =
  1. | Bind_scalar of string
  2. | Bind_ignore
  3. | Bind_collection of input_binding
  4. | Bind_tuple of input_binding list
type query_input =
  1. | Input_scalar of string * query_result
  2. | Input_entity_ref of string * entity_ref
  3. | Input_collection of string * query_result list
  4. | Input_collection_ignore of query_result list
  5. | Input_nested_collection of input_binding * query_result list
  6. | Input_tuple of string list * query_result list
  7. | Input_relation of string list * query_result list list
  8. | Input_nested_tuple of input_binding list * query_result list
  9. | Input_nested_relation of input_binding list * query_result list list
  10. | Input_predicate of string * query_result list -> bool
  11. | Input_function of string * query_result list -> query_result list option
  12. | Input_aggregate of string * query_result list -> query_result
  13. | Input_rules of query_rule list
  14. | Input_ignore
  15. | Input_scalar_decl of string
  16. | Input_collection_decl of string
  17. | Input_collection_ignore_decl
  18. | Input_ignore_decl
  19. | Input_rules_decl
  20. | Input_nested_collection_decl of input_binding
  21. | Input_tuple_decl of string list
  22. | Input_relation_decl of string list
  23. | Input_nested_tuple_decl of input_binding list
  24. | Input_nested_relation_decl of input_binding list
  25. | Input_source_decl of string
type query_arg =
  1. | Arg_scalar of query_result
  2. | Arg_entity_ref of entity_ref
  3. | Arg_collection of query_result list
  4. | Arg_tuple of query_result list
  5. | Arg_relation of query_result list list
  6. | Arg_predicate of query_result list -> bool
  7. | Arg_function of query_result list -> query_result list option
  8. | Arg_aggregate of query_result list -> query_result
  9. | Arg_rules of query_rule list
type query_form =
  1. | QueryFormNil
  2. | QueryFormBool of bool
  3. | QueryFormInt of int64
  4. | QueryFormFloat of float
  5. | QueryFormString of string
  6. | QueryFormKeyword of string
  7. | QueryFormSymbol of string
  8. | QueryFormVector of query_form list
  9. | QueryFormList of query_form list
  10. | QueryFormSet of query_form list
  11. | QueryFormTagged of string * query_form
  12. | QueryFormMap of (query_form * query_form) list
type aggregate =
  1. | Count
  2. | CountDistinct
  3. | Distinct
  4. | Sum
  5. | Avg
  6. | Median
  7. | Variance
  8. | Stddev
  9. | Min
  10. | Max
  11. | MinN of int
  12. | MaxN of int
  13. | Rand
  14. | RandN of int
  15. | Sample of int
  16. | MinNVar of string
  17. | MaxNVar of string
  18. | RandNVar of string
  19. | SampleVar of string
  20. | CustomVar of string
  21. | Custom of query_result list -> query_result
type find_spec =
  1. | Find_var of string
  2. | Find_pull of string * pull_selector list
  3. | Find_pull_form of string * query_form
  4. | Find_pull_var of string * string
  5. | Find_pull_source of string * string * pull_selector list
  6. | Find_pull_source_form of string * string * query_form
  7. | Find_pull_source_var of string * string * string
  8. | Find_aggregate of aggregate * query_term list
type query = {
  1. find : find_spec list;
  2. inputs : query_input list;
  3. with_vars : string list;
  4. rules : query_rule list;
  5. where : query_clause list;
}
type query_return =
  1. | Return_relation
  2. | Return_collection
  3. | Return_tuple
  4. | Return_scalar
type query_return_map =
  1. | Return_keys of string list
  2. | Return_syms of string list
  3. | Return_strs of string list
type query_output =
  1. | Query_relation of query_result list list
  2. | Query_collection of query_result list
  3. | Query_tuple of query_result list option
  4. | Query_scalar of query_result option
  5. | Query_relation_maps of (value * query_result) list list
  6. | Query_tuple_map of (value * query_result) list option
type index =
  1. | Eavt
  2. | Aevt
  3. | Avet
type tx_meta = (attr * value) list
type tx_report = {
  1. db_before : db;
  2. db_after : db;
  3. tx_data : datom list;
  4. tempids : (string * entity_id) list;
  5. tx_meta : tx_meta;
}
module List : sig ... end
module Built_ins : sig ... end
module Data_readers : sig ... end
module Conn : sig ... end
type conn = Conn.t
module Db : sig ... end
module Entity : sig ... end
module Lru : sig ... end
module Lookup_refs : sig ... end
module Schema : sig ... end
module Serialize : sig ... end
module Storage : sig ... end
module Util : sig ... end
module Parser : sig ... end
module Pull_parser : sig ... end
module Pull_api : sig ... end
module Upsert : sig ... end
val tx0 : tx
val datom : ?tx:tx -> ?added:bool -> e:entity_id -> a:attr -> v:value -> unit -> datom
val is_datom : datom -> bool
val empty_db : ?schema:schema -> ?storage:storage -> unit -> db
val empty : db -> db
val is_db : db -> bool
val init_db : ?schema:schema -> ?storage:storage -> datom list -> db
val filter : db -> (db -> datom -> bool) -> db
val is_filtered : db -> bool
val unfiltered_db : db -> db
val serializable : db -> serializable_db
val from_serializable : serializable_db -> db
val db_from_reader_string : string -> db
val memory_storage : unit -> storage
val file_storage : string -> storage
val store : ?storage:storage -> db -> db
val store_tail : storage -> datom list list -> unit
val restore : storage -> db option
val db_with_tail : db -> datom list list -> db
val storage : db -> storage option
val addresses : db list -> storage_address list
val settings : db -> (attr * value) list
val storage_addresses : storage -> storage_address list
val collect_garbage : storage -> unit
val db_hash : db -> int
val db_hash_cache_size : unit -> int
val diff : db -> db -> datom list * datom list * datom list
val squuid : ?msec:int64 -> unit -> value
val squuid_time_millis : value -> int64
val create_conn : ?schema:schema -> ?storage:storage -> unit -> conn
val conn_from_db : db -> conn
val conn_from_datoms : ?schema:schema -> ?storage:storage -> datom list -> conn
val restore_conn : storage -> conn option
val conn_db : conn -> db
val db : conn -> db
val is_conn : conn -> bool
val listen : conn -> string -> (tx_report -> unit) -> string
val listen_bang : conn -> string -> (tx_report -> unit) -> string
val listen_auto : conn -> (tx_report -> unit) -> string
val listen_bang_auto : conn -> (tx_report -> unit) -> string
val unlisten : conn -> string -> unit
val unlisten_bang : conn -> string -> unit
val reset_conn : ?tx_meta:tx_meta -> conn -> db -> db
val reset_conn_bang : ?tx_meta:tx_meta -> conn -> db -> db
val reset_schema : conn -> schema -> db
val reset_schema_bang : conn -> schema -> db
val schema : db -> schema
val with_schema : db -> schema -> db
val schema_of_edn_string : string -> schema
val is_reverse_ref : attr -> bool
val reverse_ref : attr -> attr
val parse_tx_data_string : string -> tx_op list
val db_with : tx_op list -> db -> db
val db_with_string : string -> db -> db
val transact : ?tx_meta:tx_meta -> db -> tx_op list -> tx_report
val transact_string : ?tx_meta:tx_meta -> db -> string -> tx_report
val with_tx : ?tx_meta:tx_meta -> db -> tx_op list -> tx_report
val with_tx_string : ?tx_meta:tx_meta -> db -> string -> tx_report
val transact_conn : ?tx_meta:tx_meta -> conn -> tx_op list -> tx_report
val transact_conn_string : ?tx_meta:tx_meta -> conn -> string -> tx_report
val transact_bang : ?tx_meta:tx_meta -> conn -> tx_op list -> tx_report
val transact_bang_string : ?tx_meta:tx_meta -> conn -> string -> tx_report
val apply_report : conn -> tx_report -> tx_report
val transact_async : ?tx_meta:tx_meta -> conn -> tx_op list -> tx_report
val transact_async_string : ?tx_meta:tx_meta -> conn -> string -> tx_report
val tempid : ?part:string -> ?value:int -> unit -> entity_ref
val resolve_tempid : ?db:db -> (string * entity_id) list -> string -> entity_id option
val entity : db -> entity_ref -> entity option
val entity_attr : entity -> attr -> tx_value option
val entity_attrs : entity -> (attr * tx_value) list
val entity_db : entity -> db
val is_entity : entity -> bool
val entity_equal : entity -> entity -> bool
val entity_hash : entity -> int
val touch : entity -> entity
val entid : db -> attr -> value -> entity_id option
val entid_ref : db -> entity_ref -> entity_id option
val read_edn : string -> query_form
val parse_binding : query_form -> input_binding
val parse_in : query_form -> query_input list
val parse_with : query_form -> string list
val parse_find : query_form -> query_return * find_spec list
val parse_pull_pattern : db -> query_form -> pull_selector list
val parse_pull_pattern_string : db -> string -> pull_selector list
val pull : ?visitor:(pull_visit -> unit) -> db -> pull_selector list -> entity_ref -> pulled_entity option
val pull_string : ?visitor:(pull_visit -> unit) -> db -> string -> entity_ref -> pulled_entity option
val pull_many : ?visitor:(pull_visit -> unit) -> db -> pull_selector list -> entity_ref list -> pulled_entity option list
val pull_many_string : ?visitor:(pull_visit -> unit) -> db -> string -> entity_ref list -> pulled_entity option list
val parse_query : query_form -> query
val parse_query_string : string -> query
val parse_query_return : query_form -> query_return * query
val parse_query_return_string : string -> query_return * query
val parse_query_return_map : query_form -> query_return * query_return_map option * query
val parse_query_return_map_string : string -> query_return * query_return_map option * query
val parse_query_return_map_string_with_pull_context : ?default_pull_db:db -> ?pull_db_for_source:(string -> db) -> string -> query_return * query_return_map option * query
module Query : sig ... end
val q : ?inputs:query_arg list -> db -> query -> query_result list list
val q_string : ?inputs:query_arg list -> db -> string -> query_result list list
val q_with : ?inputs:query_arg list -> db -> string list -> query -> query_result list list
val q_with_string : ?inputs:query_arg list -> db -> string list -> string -> query_result list list
val q_sources : ?inputs:query_arg list -> db -> (string * query_source) list -> query -> query_result list list
val q_sources_string : ?inputs:query_arg list -> db -> (string * query_source) list -> string -> query_result list list
val q_return : ?inputs:query_arg list -> db -> query_return -> query -> query_output
val q_return_string : ?inputs:query_arg list -> db -> string -> query_output
val q_return_map : ?inputs:query_arg list -> db -> query_return -> query_return_map -> query -> query_output
val q_return_map_string : ?inputs:query_arg list -> db -> string -> query_output
val datoms : db -> index -> ?e:entity_id -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom Stdlib.Seq.t
val fold_datoms : ('acc -> datom -> 'acc) -> 'acc -> db -> index -> ?e:entity_id -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> 'acc
val datoms_ref : db -> index -> ?e:entity_ref -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom Stdlib.Seq.t
val find_datom : db -> index -> ?e:entity_id -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom option
val find_datom_ref : db -> index -> ?e:entity_ref -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom option
val seek_datoms : db -> index -> ?e:entity_id -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom Stdlib.Seq.t
val seek_datoms_ref : db -> index -> ?e:entity_ref -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom Stdlib.Seq.t
val rseek_datoms : db -> index -> ?e:entity_id -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom Stdlib.Seq.t
val rseek_datoms_ref : db -> index -> ?e:entity_ref -> ?a:attr -> ?v:value -> ?tx:tx -> unit -> datom Stdlib.Seq.t
val index_range : db -> attr -> ?start:value -> ?stop:value -> unit -> datom Stdlib.Seq.t