Storage wrapper around Datomic
Storage wrapper around Datomic
(assertion-from-triple attr->type->new [e a v])
Inputs: [attr->type->new :- #:s{Keyword #:s{Keyword s/Keyword}} [e a v] :- ss/Triple] Returns: [(s/one s/Keyword "assertion") (s/one s/Any "entity") (s/one s/Keyword "attribute") (s/one s/Any "value")]
Converts a triple into a Datomic assertion
Inputs: [attr->type->new :- #:s{Keyword #:s{Keyword s/Keyword}} [e a v] :- ss/Triple] Returns: [(s/one s/Keyword "assertion") (s/one s/Any "entity") (s/one s/Keyword "attribute") (s/one s/Any "value")] Converts a triple into a Datomic assertion
(build-uri uri m)
Inputs: [uri :- URI m :- String] Returns: String
Reads a configuration map, or creates a Datomic URI. Reports an error if both are not valid
Inputs: [uri :- URI m :- String] Returns: String Reads a configuration map, or creates a Datomic URI. Reports an error if both are not valid
(create-store {uri :uri user-data :init data-file :json mp :map :as config})
Inputs: [{uri :uri, user-data :init, data-file :json, mp :map, :as config}] Returns: (s/pred (fn* [p1__6719#] (extends? Storage (class p1__6719#))))
Factory function to create a store
Inputs: [{uri :uri, user-data :init, data-file :json, mp :map, :as config}] Returns: (s/pred (fn* [p1__6719#] (extends? Storage (class p1__6719#)))) Factory function to create a store
(expand-symbol sym-test? [e a v :as pattern])
Converts a pattern with a variable attribute into a pair that converts the requested attribute into its identifier. Returns a seq of patterns.
Converts a pattern with a variable attribute into a pair that converts the requested attribute into its identifier. Returns a seq of patterns.
(file-type file)
Inputs: [file] Returns: s/Keyword
Guesses at the type of file provided
Inputs: [file] Returns: s/Keyword Guesses at the type of file provided
(generic-type d)
Determines a general data type for the given data
Determines a general data type for the given data
(get-attrib-projection {o :originals} [_ attr _ :as p])
Returns a projection function, given a pattern and the current attributes.
Returns a projection function, given a pattern and the current attributes.
(init! connection)
Inputs: [connection]
Initializes storage, and returns the result of any transaction. Returns nil if no transaction was needed.
Inputs: [connection] Initializes storage, and returns the result of any transaction. Returns nil if no transaction was needed.
(kw-from-type* t prefix)
Determines a keyword for a provided type
Determines a keyword for a provided type
(matching-vars to from)
Inputs: [to :- [s/Any] from :- [Symbol]] Returns: [[s/Num s/Num]]
Returns pairs of indexes into seqs where the vars match. For any variable that appears in both sequences, the column number in the 'from' parameter gets mapped to the column number of the same variable in the 'to' parameter.
Inputs: [to :- [s/Any] from :- [Symbol]] Returns: [[s/Num s/Num]] Returns pairs of indexes into seqs where the vars match. For any variable that appears in both sequences, the column number in the 'from' parameter gets mapped to the column number of the same variable in the 'to' parameter.
(project-row pattern mapping row)
Inputs: [pattern :- EPVPattern mapping :- [[s/Num s/Num]] row :- [Value]] Returns: [s/Any]
Creates a new EPVPattern from an existing one, based on existing bindings. Uses the mapping to copy from columns in 'row' to overwrite variables in 'pattern'. 'pattern' must be a vector. The index mappings have already been found and are in the 'mapping' argument
Inputs: [pattern :- EPVPattern mapping :- [[s/Num s/Num]] row :- [Value]] Returns: [s/Any] Creates a new EPVPattern from an existing one, based on existing bindings. Uses the mapping to copy from columns in 'row' to overwrite variables in 'pattern'. 'pattern' must be a vector. The index mappings have already been found and are in the 'mapping' argument
(read-attribute-info db)
Inputs: [db] Returns: {(s/required-key :overloads) #:s{Keyword #:s{Keyword s/Keyword}}, (s/required-key :originals) #:s{Keyword s/Keyword}, (s/required-key :types) #:s{Keyword s/Keyword}}
Reads attribute info and uses this to create 3 maps.
Inputs: [db] Returns: {(s/required-key :overloads) #:s{Keyword #:s{Keyword s/Keyword}}, (s/required-key :originals) #:s{Keyword s/Keyword}, (s/required-key :types) #:s{Keyword s/Keyword}} Reads attribute info and uses this to create 3 maps. 1. Maps overloaded attributes to a map of type->name, where the name is the attribute to use for that type. 2. Maps aliases for the overloaded attribute back to the original. 3. Maps attribute names to the type of data they hold.
(top-ids db ids acc)
Adds to an accumulator all Database entities that represent a top level entity
Adds to an accumulator all Database entities that represent a top level entity
(transaction-fn {:keys [tx-id db connection]})
Create a transaction function for the given storage configuration
Create a transaction function for the given storage configuration
(tx db)
Determines the transaction ID for a database
Determines the transaction ID for a database
(user-init-data user-data-file)
Inputs: [user-data-file :- s/Str]
Generates initialization transaction data from user data
Inputs: [user-data-file :- s/Str] Generates initialization transaction data from user data
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close