A way to interact with stored entities
A way to interact with stored entities
(add-condition schema q [condition & args])If conditions are provided, add them to the query
If conditions are provided, add them to the query
(add-ident q entity-name ident arg)Add a where clause for an ident
Add a where clause for an ident
(add-listener! env mutation handler)(add-listener! env mutation key handler)Given an environment, add a mutation handler.
The handlers is bound by key, if specified, otherwise the key will
default to the mutation key. Yields an updated environment
Given an environment, add a mutation handler. The handlers is bound by `key`, if specified, otherwise the `key` will default to the mutation key. Yields an updated environment
(build-query env entity fields)Build a base query preparing joins when needed
Build a base query preparing joins when needed
(compound-extra-fields compounds fields)Figure out which fields aren't needed once compounds have been processed on a record
Figure out which fields aren't needed once compounds have been processed on a record
(entity-schema {:keys [schema]} entity)Look up entity in schema. Takes a schema and an entity. The entity argument can take be of two different shapes: it can be a keyword that will match the namespace of the entity in question or a coll of namespaced keyword (ident name) and arguments
Look up entity in schema. Takes a schema and an entity. The entity argument can take be of two different shapes: it can be a keyword that will match the namespace of the entity in question or a coll of namespaced keyword (ident name) and arguments
(extract-ident entity result)When a query is targetting an ident, extract the first result
When a query is targetting an ident, extract the first result
(find-mutation env mutation)Fetch mutation description
Fetch mutation description
(merge-compounds-fn compounds)Merge compounds into record
Merge compounds into record
(mutate! env mutation params)(mutate! env mutation params metadata)Perform a mutation. Since mutations are spec'd, parameters are expected to conform it.
Perform a mutation. Since mutations are spec'd, parameters are expected to conform it.
(prepare-field schema field value)Conditionally apply field transform on field id if schema defines any
Conditionally apply field transform on field id if schema defines any
(process-compounds-fn schema {:seql.core/keys [fields]})Yield a schema-specific function to process compounds on the fly
Yield a schema-specific function to process compounds on the fly
(process-field schema {:keys [relations compounds fields entity]})Add necessary stanzas to realize field targeting with SQL
Add necessary stanzas to realize field targeting with SQL
Process join by relation type. Takes a base query, a map with
:entity and :table keys and a map of options to build the
relation
Process join by relation type. Takes a base query, a map with `:entity` and `:table` keys and a map of options to build the relation
(process-transforms-fn schema type)Yield a function which processes records and applies predefined transforms
Yield a function which processes records and applies predefined transforms
(qualify-key k)Given the enforced terminology at query time, yield back a qualified keyword
Given the enforced terminology at query time, yield back a qualified keyword
(qualify-result m)Qualify a result with the appropriate namespace
Qualify a result with the appropriate namespace
(query env entity)(query env entity fields)(query env entity fields conditions)Look up entities.
Look up entities.
(recompose-relations schema fields records)The join query perfomed by query returns a flat list of entries,
potentially unsorted (this is database implementation specific)
recompose a tree of entities as specified in fields.
The join query perfomed by `query` returns a flat list of entries, potentially unsorted (this is database implementation specific) recompose a tree of entities as specified in fields.
(relation-fields entity-ns row)Builds a map of <entity> -> #{<relation fields> ...}
Builds a map of <entity> -> #{<relation fields> ...}
(remove-empty-relations entity)remove cols that are all nils for an entity relation
remove cols that are all nils for an entity relation
(remove-listener! env mutation)(remove-listener! env mutation key)Given an environment, remove a mutation handler by key if
specified, otherwise it will remove a handler that match the
mutation key. Yields an updated environment.
Given an environment, remove a mutation handler by `key` if specified, otherwise it will remove a handler that match the mutation `key`. Yields an updated environment.
(sql-query env entity fields conditions)Build a SQL query for the pull-syntax expressed. This is an incremental data-based creation of a
Build a SQL query for the pull-syntax expressed. This is an incremental data-based creation of a
(transform-for-join k)Takes a namespace keyword and returns an identifier in valid SQL format
Takes a namespace keyword and returns an identifier in valid SQL format
(transform-out k)Takes a namespaced keyword and prepare name transforms. Returns a tuple of database name to aliased name.
Takes a namespaced keyword and prepare name transforms. Returns a tuple of database name to aliased name.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |