CrossClj

0.1.1 docs

SourceDocs



RECENT
    VARS
    ->Relation
    add-index
    add-relation
    add-to-indexes
    add-tuple
    add-tuples
    any-match?
    database-counts
    database-merge
    database-merge-parallel
    datalog-database
    datalog-relation
    empty-database
    ensure-relation
    find-indexes
    get-relation
    make-database
    map->Relation
    match?
    merge-indexes
    merge-relations
    modify-indexes
    remove-from-indexes
    remove-tuple
    replace-relation
    scan-space
    select

    « Index of all namespaces of this project

    (->Relation schema data indexes)
    Positional factory function for class datalog.database.Relation.
    
    (add-index db name key)
    Adds an index to an empty relation named name
    
    (add-relation db name keys)
    Adds a relation to the database
    
    Private
    (add-to-indexes idxs tuple)
    Adds the tuple to the appropriate keys in the index map
    
    (add-tuple db rel-name tuple)(add-tuple rel tuple)
    Two forms:
    
    [db relation-name tuple] adds tuple to the named relation.  Returns
    the new database.
    
    [rel tuple] adds to the relation object.  Returns the new relation.
    (add-tuples db & tupls)
    Adds a collection of tuples to the db, as
    (add-tuples db
       [:rel-name :key-1 1 :key-2 2]
       [:rel-name :key-1 2 :key-2 3])
    (any-match? db rn pt)
    Finds if there are any matching records for the partial tuple
    
    (database-counts db)
    Returns a map with the count of elements in each relation.
    
    (database-merge dbs)
    Merges databases together
    
    (database-merge-parallel dbs)
    Merges databases together in parallel
    
    (datalog-database rels)
    (datalog-relation schema data indexes)
    Creates a relation
    
    (ensure-relation db name keys indexes)
    If the database lacks the named relation, add it
    
    Private
    (find-indexes idxs pt)
    Given a map of indexes and a partial tuple, return the sets of full tuples
    
    (get-relation db rel-name)
    Get a relation object by name
    
    macro
    (make-database & commands)
    Makes a database, like this
    (make-database
      (relation :fred [:mary :sue])
      (index :fred :mary)
      (relation :sally [:jen :becky])
      (index :sally :jen)
      (index :sally :becky))
    (map->Relation m__7585__auto__)
    Factory function for class datalog.database.Relation, taking a map of keywords to field values.
    
    Private
    (match? m1 m2)
    Is m2 contained in m1?
    
    (merge-indexes idx1 idx2)
    (merge-relations r1 r2)
    Merges two relations
    
    Private
    (modify-indexes idxs tuple f)
    Perform f on the indexed tuple-set.  f should take a set and tuple,
    and return the new set.
    Private
    (remove-from-indexes idxs tuple)
    Removes the tuple from the appropriate keys in the index map
    
    (remove-tuple db rel-name tuple)(remove-tuple rel tuple)
    Two forms:
    
    [db relation-name tuple] removes the tuple from the named relation,
    returns a new database.
    
    [rel tuple] removes the tuple from the relation.  Returns the new
    relation.
    (replace-relation db rel-name rel)
    Add or replace a fully constructed relation object to the database.
    
    Private
    (scan-space fun db rn pt)
    Computes a stream of tuples from relation rn matching partial tuple (pt)
    and applies fun to each
    (select db rn pt)
    finds all matching tuples to the partial tuple (pt) in the relation named (rn)