Liking cljdoc? Tell your friends :D
All platforms.

lambdaconnect-sync.db-interface


IDatabaseDriverclj/sprotocol

Database driver protocol. Allows lambdaconnect-sync to interact with arbitrary database. Entity or relationship refers to objects taken from entities-by-name.

Database driver protocol. Allows lambdaconnect-sync to interact with arbitrary database.
Entity or relationship refers to objects taken from entities-by-name.

objects-by-uuidsclj/s

(objects-by-uuids this snapshot entity uuids fetch-inverses?)

Fetches objects that match the entity and uuids. Objects that do not conform to entity will not be returned. Returns them in the same format as objects-by-ids.

Fetches objects that match the entity and uuids. Objects that do not conform to entity will not be returned. 
Returns them in the same format as objects-by-ids.

referenced-objectsclj/s

(referenced-objects this snapshot relationship uuids)

For a given relationship and list of uuids, returns a set of uuids (or nil) that represent objects referenced by the ones in uuids collection through relationship.

For a given relationship and list of uuids, 
returns a set of uuids (or nil) that represent objects referenced by the 
ones in uuids collection through relationship.

misclassified-objectsclj/s

(misclassified-objects this snapshot entity uuids)

Returns objects (in the form given by objects-by-ids with inverse:false) that do not belong to entity but are found in uuids map.

Returns objects (in the form given by objects-by-ids with inverse:false) 
that do not belong to entity but are found in uuids map.

sync-revisionclj/s

(sync-revision this snapshot)

Returns sync revision of a snapshot.

Returns sync revision of a snapshot.

related-objectsclj/s

(related-objects this snapshot relationship uuids)

For a given relationship and list of uuids, returns a set of uuids (or nil) that represent objects refering to the ones in uuids collection through relationship.

For a given relationship and list of uuids, 
returns a set of uuids (or nil) that represent objects refering to the 
ones in uuids collection through relationship.

id-for-uuidclj/s

(id-for-uuid this snapshot entity uuid)

Returns db id for uuid/entity pair, or nil if there is any mismatch.

Returns db id for uuid/entity pair, or nil if there is any mismatch.

uuids-for-idsclj/s

(uuids-for-ids this snapshot ids)

Returns uuids for given internal ids.

Returns uuids for given internal ids.

as-ofclj/s

(as-of this snapshot sync-revision)

Returns database as if it was viewed through given sync revision.

Returns database as if it was viewed through given sync revision.

check-uuids-for-entityclj/s

(check-uuids-for-entity this snapshot entity-name uuids)

Returns a subset of uuids (uuids is a sequence, retval is a set) that belong to given entity.

Returns a subset of uuids (uuids is a sequence, retval is a set) that belong to given entity.

objects-by-idsclj/s

(objects-by-ids this snapshot entity ids fetch-inverses?)

Fetches objects that match the entity and ids (as any sequence). Objects that do not conform to entity will not be returned. The format is:

{:app/uuid #"some-uuid" :app/createdAt #some-date :app/updatedAt #some-date :NOUser/someAttribute #some-value :NOUser/someRelationshipToMany [{:app/uuid #uuid :db/id #id} ...] :NOUser/someRelationshipToOne {:app/uuid #uuid :db/id #id} :NOLocation/_thisIsSomeInverseRelationshipToMany [{:app/uuid #uuid :db/id #id} ...] ;; if fetch-inverse? is true :NOLocation/_thisIsSomeInverseRelationshipToOne [{:app/uuid #uuid :db/id #id}] ;; if fetch-inverse? is true. Note that inverses are a collection even in to-one case. }

Please note that it is not guaranteed what collection holds relationships. It might be a vector, list, lazy coll or even a set (since relationships are never ordered).

Fetches objects that match the entity and ids (as any sequence). Objects that do not conform to entity will not be returned.
The format is:

{:app/uuid #"some-uuid"
 :app/createdAt #some-date
 :app/updatedAt #some-date
 :NOUser/someAttribute #some-value
 :NOUser/someRelationshipToMany [{:app/uuid #uuid :db/id #id} ...]
 :NOUser/someRelationshipToOne {:app/uuid #uuid :db/id #id}
 :NOLocation/_thisIsSomeInverseRelationshipToMany [{:app/uuid #uuid :db/id #id} ...] ;; if fetch-inverse? is true
 :NOLocation/_thisIsSomeInverseRelationshipToOne [{:app/uuid #uuid :db/id #id}] ;; if fetch-inverse? is true. Note that inverses are a collection even in to-one case.
}

Please note that it is not guaranteed what collection holds relationships. It might be a vector, list, lazy coll or even a set (since relationships are never ordered).

speculateclj/s

(speculate this snapshot transaction)

Returns a new snapshot with transaction applied to it (temporarily)

Returns a new snapshot with transaction applied to it (temporarily)

changed-idsclj/s

(changed-ids this snapshot entity sync-revision scoped-ids)

Returns internal ids of entities that have been modified since sync-revision version of db. If scoped-ids is present, only a subset of scoped-ids is returned.

Returns internal ids of entities that have been modified 
since sync-revision version of db. If scoped-ids is present, only a subset of 
scoped-ids is returned. 
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close