thread-local hierarchial datastructure that maps collections to map', where map' associates an attribute k to a function (λ [user-scope-tuple] -> [v' c]) that can map the value of attribute k to the value v' if necessary. If the calculation was necessary the c denotes true. If and only if there was any calculation necessary then the user-scope-tuple will contain an association vlicCalculated: xs where x:xs is an attribute a value was calculated before.
thread-local hierarchial datastructure that maps collections to map', where map' associates an attribute k to a function (λ [user-scope-tuple] -> [v' c]) that can map the value of attribute k to the value v' if necessary. If the calculation was necessary the c denotes true. If and only if there was any calculation necessary then the user-scope-tuple will contain an association vlicCalculated: xs where x:xs is an attribute a value was calculated before.
(alter-document tx coll-name user-scope-tuple fn & args)
alters a document given by [user-scope-tuple] within the collection denoted by [coll-name] by applying the function [fn] with the parameters [args] to it. An user-scope-tuple can be obtained using find-first, find and select. returns the new user value
alters a document given by [user-scope-tuple] within the collection denoted by [coll-name] by applying the function [fn] with the parameters [args] to it. An user-scope-tuple can be obtained using find-first, find and select. returns the new user value
(applicable-indexes' tx coll key)
checks whether collection :coll within the context of a transaction :tx provides an applicable attribute index for the attribute seq :key
checks whether collection :coll within the context of a transaction :tx provides an applicable attribute index for the attribute seq :key
(coll-count tx coll-name)
returns the number of elements in a collection with name [coll-name]
returns the number of elements in a collection with name [coll-name]
(coll-empty? tx coll-name)
returns true iff the collection with name [coll-name] is empty
returns true iff the collection with name [coll-name] is empty
(application this)
returns a set of database actions this constraint type is relevant for
returns a set of database actions this constraint type is relevant for
(postcommit this ctx coll application coll-tuple)
This function gets called after a key/value pair is inserted to/updated within a collection. Constraint like indexes implement this for the update of the very index after the update to the key/value pair data structure took place
This function gets called after a key/value pair is inserted to/updated within a collection. Constraint like indexes implement this for the update of the very index after the update to the key/value pair data structure took place
(precommit this ctx coll application key value)
This function gets called before a key/value pair is inserted to/updated within a collection. Implementing this function if a necessary precondition needs to be checked before performing an costly update to the underlying datastructure holding the key/value pair. Implementations should raise. Here ctx aims to handle constraint to need to check on other collections as well
This function gets called before a key/value pair is inserted to/updated within a collection. Implementing this function if a necessary precondition needs to be checked before performing an costly update to the underlying datastructure holding the key/value pair. Implementations should raise. Here ctx aims to handle constraint to need to check on other collections as well
donotes database actions suitable for certain types of domains
donotes database actions suitable for certain types of domains
(contains-key? coll key)
returns true iff the collection [coll] contains a tuple whose key is equal to the user key [key].
returns true iff the collection [coll] contains a tuple whose key is equal to the user key [key].
(create-attribute-index name unique a)
creates an attribute index for attributes a
creates an attribute index for attributes a
(create-referenced-integrity-constraint name referencing-coll referencing-key)
(create-referrer-integrity-constraint name foreign-coll foreign-key)
(create-tx ctx & opts)
creates a transaction upon user-scope function like select, insert, alter-document, delete can be executed. Iff an eviction channel is assigned to a collection then this channel needs to be started otherwise a
creates a transaction upon user-scope function like select, insert, alter-document, delete can be executed. Iff an eviction channel is assigned to a collection then this channel needs to be started otherwise a
(create-unique-key key)
(create-unique-key coll key)
(create-unique-key coll key primary-key)
creates a unique key [key running] from a user space key using the running bigint index key is a seq of attributes values for all attributes of the index We pass in primary key in order to sort indexed results by primary-key.
creates a unique key [key running] from a user space key using the running bigint index key is a seq of attributes values for all attributes of the index We pass in primary key in order to sort indexed results by primary-key.
(create-unique-stop-key key primary-key-is-string)
creates a unique key [key running] that can be used for < and <= comparator
creates a unique key [key running] that can be used for < and <= comparator
(delete tx coll-name key)
deletes a document by key [key] from collection with name [coll-name] using the transaction [tx]. the transaction can be created from context using (create-tx [context]. returns number of removed items.
deletes a document by key [key] from collection with name [coll-name] using the transaction [tx]. the transaction can be created from context using (create-tx [context]. returns number of removed items.
(find-first coll key)
returns the first collection tuple whose key is equal to the user key [key]. This is not a userscope method.
returns the first collection tuple whose key is equal to the user key [key]. This is not a userscope method.
(applicable? this key)
return true iff this index can be used to find values as per the given key.
return true iff this index can be used to find values as per the given key.
(find this start-test start-key stop-test stop-key)
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized or (stop-test stop-key) is fulfilled. start-test as well as stop-test are of >,>=,<,<=. The returning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized or (stop-test stop-key) is fulfilled. start-test as well as stop-test are of >,>=,<,<=. The returning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v
(find-without-stop this start-test start-key)
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized. start-test is of >,>=,<,<=. The returning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized. start-test is of >,>=,<,<=. The returning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v
(get-data this)
For testing purposes
For testing purposes
(rating this key)
returns a natural number denoting an order by which two indexes can be compared in order to use one for a finding a certain key. the index with the lower rating result wins
returns a natural number denoting an order by which two indexes can be compared in order to use one for a finding a certain key. the index with the lower rating result wins
(insert tx coll-name key value)
inserts a document [value] by key [key] into collection with name [coll-name] using the transaction [tx]. the transaction can be created from context using (create-tx [context])
inserts a document [value] by key [key] into collection with name [coll-name] using the transaction [tx]. the transaction can be created from context using (create-tx [context])
(insert-raw tx coll-name key value)
ONLY FOR INTERNAL PURPOSE
ONLY FOR INTERNAL PURPOSE
(rfind this start-test start-key stop-test stop-key)
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized or (stop-test stop-key) is fulfilled. start-test as well as stop-test are of >,>=,<,<=. The retcrrning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v. yields reverse order
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized or (stop-test stop-key) is fulfilled. start-test as well as stop-test are of >,>=,<,<=. The retcrrning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v. yields reverse order
(rfind-without-stop this start-test start-key)
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized. start-test is of >,>=,<,<=. The returning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v. yields reverse order
takes all values from the collection using this index that fulfil (start-test start-key) until the collection is fully realized. start-test is of >,>=,<,<=. The returning sequence contains of items [[uk i] (ref v)], where uk is the user-key, i is the running index for the collection and (ref v) denotes a STM reference type instance to the value v. yields reverse order
(rselect tx coll-name)
(rselect tx coll-name start-test start-key)
(rselect tx coll-name attributes start-test start-key)
(rselect tx coll-name start-test start-key stop-test stop-key)
(rselect tx coll-name attributes start-test start-key stop-test stop-key)
REVERSE ORDER SELECT. test(s) one of <, <=, > or
=. Returns a seq of those entries [key, value] with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true. iff just [tx] and coll-name are given, then we return all tupels starting from the highest rank to the lowest rank
REVERSE ORDER SELECT. test(s) one of <, <=, > or >=. Returns a seq of those entries [key, value] with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true. iff just [tx] and coll-name are given, then we return all tupels starting from the highest rank to the lowest rank
(rselect-from-coll coll attributes start-test start-key)
(rselect-from-coll coll attributes start-test start-key stop-test stop-key)
Secondary index scan in reverse order
Secondary index scan in reverse order
(select tx coll-name)
(select tx coll-name start-test start-key)
(select tx coll-name attributes start-test start-key)
(select tx coll-name start-test start-key stop-test stop-key)
(select tx coll-name attributes start-test start-key stop-test stop-key)
test(s) one of <, <=, > or
=. Returns a seq of those entries [key, value] with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true. iff just [tx] and coll-name are given, then we return all tupels.
test(s) one of <, <=, > or >=. Returns a seq of those entries [key, value] with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true. iff just [tx] and coll-name are given, then we return all tupels.
(select-first tx coll-name key)
returns the first key/value pair of the collection [coll-name] that matches the key [key] or nil
returns the first key/value pair of the collection [coll-name] that matches the key [key] or nil
(select-from-coll coll attributes start-test start-key)
(select-from-coll coll attributes start-test start-key stop-test stop-key)
Secondary index scan
Secondary index scan
(tree tx coll-name user-scope-tuple & opts)
takes a document [user-scope-tuple] from the collection with name [coll-name] and gives back derived document where all foreign keys are replaced by their respective documents.
takes a document [user-scope-tuple] from the collection with name [coll-name] and gives back derived document where all foreign keys are replaced by their respective documents.
(tree-referencees tx coll-name user-scope-tuple & opts)
takes a document [user-scope-tuple] from the collection with name [coll-name] and gives back a hash-map denoting all foreign-key referenced documents. The key in hash-map is [coll-name user-scope-key].
takes a document [user-scope-tuple] from the collection with name [coll-name] and gives back a hash-map denoting all foreign-key referenced documents. The key in hash-map is [coll-name user-scope-key].
(user-scope-key user-scope-tuple)
takes a user-scope-tuple into account and returns the user scope key that was provided when storing this document
takes a user-scope-tuple into account and returns the user scope key that was provided when storing this document
(user-scope-tuple x)
(user-scope-tuple scoped-calculated-field-lambdas x)
within a collection a key-value-pair consists of k -> r, where k is [uk i], r is a STM reference to document v, uk is the key the user used to store document v. i is a running index that allows the uk being non-unique with respect to the collection. since v is wrapped by an STM reference we provide back the raw value v in order to prevent the user from altering the value using STM mechanism directly, since this would bypass the secondary indexes and make them invalid.
within a collection a key-value-pair consists of k -> r, where k is [uk i], r is a STM reference to document v, uk is the key the user used to store document v. i is a running index that allows the uk being non-unique with respect to the collection. since v is wrapped by an STM reference we provide back the _raw_ value v in order to prevent the user from altering the value using STM mechanism directly, since this would bypass the secondary indexes and make them invalid.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close