Datascriptinclude module type of Datascript_typesand value = | Nil| Int64 of int64| Float of float| String of string| Symbol of string| Bool of bool| Keyword of string| Uuid of string| Instant of int64| Regex of string| Ref of entity_id| List of value list| Vector of value list| Map of (value * value) list| Set of value list| Tuple of value option list| TxRef| Ref_to of entity_reftype schema_attr = {cardinality : cardinality;unique : unique option;indexed : bool;is_component : bool;no_history : bool;doc : string option;value_type : value_type option;tuple_attrs : attr list option;tuple_types : value_type list option;}type schema = (attr * schema_attr) listtype storage_root = {storage_schema : schema;storage_schema_idents : (entity_id * attr) list;storage_max_eid : entity_id;storage_max_tx : tx;storage_eavt : storage_address;storage_aevt : storage_address;storage_avet : storage_address;storage_eavt_metadata : storage_index_metadata option;storage_aevt_metadata : storage_index_metadata option;storage_avet_metadata : storage_index_metadata option;storage_duplicate_datoms : datom list;storage_max_addr : int;storage_branching_factor : int;storage_ref_type : Persistent_sorted_set.ref_type;}type storage_payload = | Storage_root of storage_root| Storage_node of datom Persistent_sorted_set.stored_node| Storage_tail of datom list listtype storage = {storage_store : (storage_address * storage_payload) list -> unit;storage_restore : storage_address -> storage_payload option;storage_list_addresses : unit -> storage_address list;storage_delete : storage_address list -> unit;}type tx_op = | Add of entity_ref * attr * value| Retract of entity_ref * attr * value option| RetractEntity of entity_ref| RetractAttr of entity_ref * attr| CompareAndSet of entity_ref * attr * value option * value| Entity of tx_entity| Raw_datom of datom| InstallTxFn of entity_ref * db -> value list -> tx_op list| CallIdent of entity_ref * value list| Call of db -> tx_op listand db = {db_uid : int;schema : schema;eavt_index : datom Persistent_sorted_set.t;aevt_index : datom Persistent_sorted_set.t;avet_index : datom Persistent_sorted_set.t;aevt_by_attr : (attr, datom list) Stdlib.Hashtbl.t;avet_by_attr : (attr, datom list) Stdlib.Hashtbl.t;duplicate_datoms : datom list;duplicate_aevt_datoms : datom list;duplicate_avet_datoms : datom list;duplicate_eavt_by_entity : (entity_id, datom list) Stdlib.Hashtbl.t;duplicate_aevt_by_attr : (attr, datom list) Stdlib.Hashtbl.t;duplicate_avet_by_attr : (attr, datom list) Stdlib.Hashtbl.t;max_eid : entity_id;max_datom_e : entity_id;max_tx : tx;filter_pred : (datom -> bool) option;storage_ref : storage option;tx_fns : (entity_id * (db -> value list -> tx_op list)) list;}and pull_key = valueand pulled_value = | Pulled_scalar of value| Pulled_many of pulled_value list| Pulled_entity of pulled_entitytype pull_selector = | Pull_id| Pull_wildcard| Pull_attr of attr| Pull_attr_default of attr * value| Pull_attr_limit of attr * int| Pull_attr_unlimited of attr| Pull_attr_xform of attr * pulled_value -> pulled_value| Pull_attr_default_xform of attr * value * pulled_value -> pulled_value| Pull_ref of attr * pull_selector list| Pull_ref_default of attr * pull_selector list * value| Pull_ref_limit of attr * pull_selector list * int| Pull_ref_unlimited of attr * pull_selector list| Pull_ref_xform of attr * pull_selector list * pulled_value -> pulled_value| Pull_recursive_ref of attr * pull_selector list * int option| Pull_reverse_ref of attr * pull_selector list| Pull_reverse_ref_default of attr * pull_selector list * value| Pull_reverse_ref_limit of attr * pull_selector list * int| Pull_reverse_ref_unlimited of attr * pull_selector list| Pull_reverse_ref_xform of attr
* pull_selector list
* pulled_value ->
pulled_value| Pull_as of pull_selector * pull_keytype query_result = | Result_entity of entity_id| Result_attr of attr| Result_value of value| Result_db of db| Result_pull of pulled_entitytype query_clause = | Pattern of query_term * query_term * query_term| PatternTx of query_term * query_term * query_term * query_term| PatternTxOp of query_term * query_term * query_term * query_term * query_term| SourcePattern of string * query_term * query_term * query_term| SourcePatternTx of string * query_term * query_term * query_term * query_term| SourcePatternTxOp of string
* query_term
* query_term
* query_term
* query_term
* query_term| SourceRelationPattern of string * query_term list| Missing of query_term * query_term| SourceMissing of string * query_term * query_term| GetElse of query_term * query_term * query_term * string| SourceGetElse of string * query_term * query_term * query_term * string| GetSome of query_term * query_term list * string * string| SourceGetSome of string * query_term * query_term list * string * string| GetValue of query_term * query_term * string| GetDefaultValue of query_term * query_term * query_term * string| CountValue of query_term * string| EmptyValue of query_term| NotEmptyValue of query_term| ContainsValue of query_term * query_term| ValuePredicate of value_predicate * query_term| NumericPredicate of numeric_predicate * query_term| ComparisonPredicate of comparison_predicate * query_term * query_term| ComparisonPredicateN of comparison_predicate * query_term list| EqualityPredicate of equality_predicate * query_term list| ArithmeticValue of arithmetic_op * query_term list * string| CompareValue of query_term * query_term * string| ExtremumValue of extremum_op * query_term list * string| BooleanPredicate of boolean_predicate * query_term| BooleanNotPredicate of query_term| BooleanNotValue of query_term * string| IdentityValue of query_term * string| BooleanAndPredicate of query_term list| BooleanAndValue of query_term list * string| BooleanOrPredicate of query_term list| BooleanOrValue of query_term list * string| RandomValue of string| RandomIntValue of query_term * string| DifferPredicate of query_term list| IdenticalPredicate of query_term * query_term| TypeValue of query_term * string| MetaValue of query_term * string| NameValue of query_term * string| NamespaceValue of query_term * string| KeywordFromName of query_term * string| KeywordFromNamespaceName of query_term * query_term * string| StringIncludesValue of query_term * query_term| StringStartsWithValue of query_term * query_term| StringEndsWithValue of query_term * query_term| StringLowerCaseValue of query_term * string| StringUpperCaseValue of query_term * string| StringCapitalizeValue of query_term * string| StringReverseValue of query_term * string| StringTrimValue of query_term * string| StringTrimLeftValue of query_term * string| StringTrimRightValue of query_term * string| StringTrimNewlineValue of query_term * string| StringIndexOfValue of query_term * query_term * string| StringLastIndexOfValue of query_term * query_term * string| StringSubstringValue of query_term * query_term * query_term option * string| StringBuildValue of query_term list * string| PrintStringValue of query_term list * string| PrintLineStringValue of query_term list * string| PrStringValue of query_term list * string| PrnStringValue of query_term list * string| StringJoinPlainValue of query_term * string| StringJoinValue of query_term * query_term * string| StringReplaceValue of query_term * query_term * query_term * string| StringReplaceFirstValue of query_term * query_term * query_term * string| StringEscapeValue of query_term * query_term * string| RePatternValue of query_term * string| ReFindValue of query_term * query_term * string| ReMatchesValue of query_term * query_term * string| ReSeqValue of query_term * query_term * string| ReFindPredicate of query_term * query_term| ReMatchesPredicate of query_term * query_term| StringBlankValue of query_term| StringSplitValue of query_term * query_term * string| StringSplitLimitValue of query_term * query_term * query_term * string| StringSplitLinesValue of query_term * string| Ground of value * string| GroundCollection of value list * string| GroundTuple of value list * string list| GroundRelation of value list list * string list| GroundTerm of query_term * string| GroundTermCollection of query_term * string| GroundTermTuple of query_term * string list| GroundTermRelation of query_term * string list| VectorValue of query_term list * string| ListValue of query_term list * string| SetValue of query_term list * string| HashMapValue of query_term list * string| ArrayMapValue of query_term list * string| RangeEndValue of query_term * string| RangeValue of query_term * query_term * string| RangeStepValue of query_term * query_term * query_term * string| TupleFunction of query_term list * string| UntupleFunction of query_term * string list| Predicate of string * query_term list * query_result list -> bool| Function of string
* query_term list
* string list
* query_result list ->
query_result list option| DynamicPredicate of string * query_term list| DynamicFunction of string * query_term list * string list| DynamicFunctionCollection of string * query_term list * string| DynamicFunctionRelation of string * query_term list * string list| SourceClause of string * query_clause| Not of query_clause list| SourceNot of string * query_clause list| NotJoin of string list * query_clause list| SourceNotJoin of string * string list * query_clause list| Or of query_clause list list| SourceOr of string * query_clause list list| OrJoin of string list * query_clause list list| SourceOrJoin of string * string list * query_clause list list| OrJoinRequired of string list * string list * query_clause list list| SourceOrJoinRequired of string
* string list
* string list
* query_clause list list| Rule of string * query_term list| SourceRule of string * string * query_term listtype input_binding = | Bind_scalar of string| Bind_ignore| Bind_collection of input_binding| Bind_tuple of input_binding listtype query_input = | Input_scalar of string * query_result| Input_entity_ref of string * entity_ref| Input_collection of string * query_result list| Input_collection_ignore of query_result list| Input_nested_collection of input_binding * query_result list| Input_tuple of string list * query_result list| Input_relation of string list * query_result list list| Input_nested_tuple of input_binding list * query_result list| Input_nested_relation of input_binding list * query_result list list| Input_predicate of string * query_result list -> bool| Input_function of string * query_result list -> query_result list option| Input_aggregate of string * query_result list -> query_result| Input_rules of query_rule list| Input_ignore| Input_scalar_decl of string| Input_collection_decl of string| Input_collection_ignore_decl| Input_ignore_decl| Input_rules_decl| Input_nested_collection_decl of input_binding| Input_tuple_decl of string list| Input_relation_decl of string list| Input_nested_tuple_decl of input_binding list| Input_nested_relation_decl of input_binding list| Input_source_decl of stringtype query_arg = | Arg_scalar of query_result| Arg_entity_ref of entity_ref| Arg_collection of query_result list| Arg_tuple of query_result list| Arg_relation of query_result list list| Arg_predicate of query_result list -> bool| Arg_function of query_result list -> query_result list option| Arg_aggregate of query_result list -> query_result| Arg_rules of query_rule listtype query_form = | QueryFormNil| QueryFormBool of bool| QueryFormInt of int64| QueryFormFloat of float| QueryFormString of string| QueryFormKeyword of string| QueryFormSymbol of string| QueryFormVector of query_form list| QueryFormList of query_form list| QueryFormSet of query_form list| QueryFormTagged of string * query_form| QueryFormMap of (query_form * query_form) listtype aggregate = | Count| CountDistinct| Distinct| Sum| Avg| Median| Variance| Stddev| Min| Max| MinN of int| MaxN of int| Rand| RandN of int| Sample of int| MinNVar of string| MaxNVar of string| RandNVar of string| SampleVar of string| CustomVar of string| Custom of query_result list -> query_resulttype find_spec = | Find_var of string| Find_pull of string * pull_selector list| Find_pull_form of string * query_form| Find_pull_var of string * string| Find_pull_source of string * string * pull_selector list| Find_pull_source_form of string * string * query_form| Find_pull_source_var of string * string * string| Find_aggregate of aggregate * query_term listtype query = {find : find_spec list;inputs : query_input list;with_vars : string list;rules : query_rule list;where : query_clause list;}type query_output = | Query_relation of query_result list list| Query_collection of query_result list| Query_tuple of query_result list option| Query_scalar of query_result option| Query_relation_maps of (value * query_result) list list| Query_tuple_map of (value * query_result) list optionmodule List : sig ... endmodule Built_ins : sig ... endmodule Data_readers : sig ... endmodule Conn : sig ... endtype conn = Conn.tmodule Db : sig ... endmodule Entity : sig ... endmodule Lru : sig ... endmodule Lookup_refs : sig ... endmodule Schema : sig ... endmodule Serialize : sig ... endmodule Storage : sig ... endmodule Util : sig ... endmodule Parser : sig ... endmodule Pull_parser : sig ... endmodule Pull_api : sig ... endmodule Upsert : sig ... endval tx0 : txval is_datom : datom -> boolval is_db : db -> boolval is_filtered : db -> boolval serializable : db -> serializable_dbval from_serializable : serializable_db -> dbval db_from_reader_string : string -> dbval memory_storage : unit -> storageval file_storage : string -> storageval addresses : db list -> storage_address listval storage_addresses : storage -> storage_address listval collect_garbage : storage -> unitval db_hash : db -> intval squuid : ?msec:int64 -> unit -> valueval squuid_time_millis : value -> int64val is_conn : conn -> boolval unlisten : conn -> string -> unitval unlisten_bang : conn -> string -> unitval schema_of_edn_string : string -> schemaval is_reverse_ref : attr -> boolval parse_tx_data_string : string -> tx_op listval tempid : ?part:string -> ?value:int -> unit -> entity_refval entity : db -> entity_ref -> entity optionval is_entity : entity -> boolval entity_hash : entity -> intval entid_ref : db -> entity_ref -> entity_id optionval read_edn : string -> query_formval parse_binding : query_form -> input_bindingval parse_in : query_form -> query_input listval parse_with : query_form -> string listval parse_find : query_form -> query_return * find_spec listval parse_pull_pattern : db -> query_form -> pull_selector listval parse_pull_pattern_string : db -> string -> pull_selector listval pull :
?visitor:(pull_visit -> unit) ->
db ->
pull_selector list ->
entity_ref ->
pulled_entity optionval pull_string :
?visitor:(pull_visit -> unit) ->
db ->
string ->
entity_ref ->
pulled_entity optionval pull_many :
?visitor:(pull_visit -> unit) ->
db ->
pull_selector list ->
entity_ref list ->
pulled_entity option listval pull_many_string :
?visitor:(pull_visit -> unit) ->
db ->
string ->
entity_ref list ->
pulled_entity option listval parse_query : query_form -> queryval parse_query_string : string -> queryval parse_query_return : query_form -> query_return * queryval parse_query_return_string : string -> query_return * queryval parse_query_return_map :
query_form ->
query_return * query_return_map option * queryval parse_query_return_map_string :
string ->
query_return * query_return_map option * queryval 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 * querymodule Query : sig ... endval q : ?inputs:query_arg list -> db -> query -> query_result list listval q_string : ?inputs:query_arg list -> db -> string -> query_result list listval q_with :
?inputs:query_arg list ->
db ->
string list ->
query ->
query_result list listval q_with_string :
?inputs:query_arg list ->
db ->
string list ->
string ->
query_result list listval q_sources :
?inputs:query_arg list ->
db ->
(string * query_source) list ->
query ->
query_result list listval q_sources_string :
?inputs:query_arg list ->
db ->
(string * query_source) list ->
string ->
query_result list listval q_return :
?inputs:query_arg list ->
db ->
query_return ->
query ->
query_outputval q_return_string : ?inputs:query_arg list -> db -> string -> query_outputval q_return_map :
?inputs:query_arg list ->
db ->
query_return ->
query_return_map ->
query ->
query_outputval q_return_map_string :
?inputs:query_arg list ->
db ->
string ->
query_output