(->column-name entity field-name)
Add quoting for table name if field spec include :wrap? flag
Add quoting for table name if field spec include :wrap? flag
(->pgobject x)
Transforms Clojure data to a PGobject that contains the data as JSON.
PGObject type defaults to jsonb
but can be changed via metadata key :pgtype
Transforms Clojure data to a PGobject that contains the data as JSON. PGObject type defaults to `jsonb` but can be changed via metadata key `:pgtype`
(<-pgobject v)
Transform PGobject containing json
or jsonb
value to Clojure data.
Transform PGobject containing `json` or `jsonb` value to Clojure data.
(coerce-nested-records entity record)
Nested records returned as JSON. This function will use nested entity spec to coerce record fields
Nested records returned as JSON. This function will use nested entity spec to coerce record fields
(entity-columns entity)
Collect columns names as keywords
Collect columns names as keywords
(entity-select-query entity fields nested)
Build the main entity SQL query as HoneySQL DSL
Build the main entity SQL query as HoneySQL DSL
(get-refs-list entity nested)
Returns the list of ref fields. nest param is used to control which fields is required
Returns the list of ref fields. *nest* param is used to control which fields is required
(get-values data columns-fn)
Get values vector from data
Get values vector from data
(lift-all x)
Takes a collection and will lift all items in it if possible
Takes a collection and will lift all items in it if possible
(lift-data x)
Wraps vector or map with :lift operator to store them as json
Wraps vector or map with :lift operator to store them as json
(pg-delete! database entity {:keys [where] :as params})
Delete record from database
Delete record from database
(pg-find! database entity {:keys [fields where nested] :as params})
Get single record from the database
Get single record from the database
(pg-find-all! database
entity
{:keys [fields where order-by limit offset nested] :as params})
Return multiple records from the database
Return multiple records from the database
(pg-save! database entity data)
Save record in database
Save record in database
(pg-update! database entity data {:keys [where] :as params})
Update record in database
Update record in database
(prep-join-query {:keys [entity ref table-name ref-key ref-name nested]})
Returns a SQL query vector to join rows from the referenced table
Returns a SQL query vector to join rows from the referenced table
(prep-json-query {:keys [ref table-name ref-name join-query]})
Takes the join query for nested tables and wraps it with SQL query to convert nested records into JSON
Takes the join query for nested tables and wraps it with SQL query to convert nested records into JSON
(simple-val-or-nested-entity [_ field-schema])
Predicate function to check if field spec refers to a simple data type or json field or mandatory dependency entity
Predicate function to check if field spec refers to a simple data type or json field or mandatory dependency entity
(wrap-coalesce query)
Wrap query with coalesce expression
Wrap query with coalesce expression
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close