Liking cljdoc? Tell your friends :D

bf.crud.utils


condition?clj

(condition? vec)
source

generate-conditionclj

(generate-condition key value)
source

generate-updateclj

(generate-update db table map)

Generate a hugsql map for an update statement by primary key. Return nil if the primary key is not present or if all keys that forms a primary key are not present in the map.

Generate a hugsql map for an update statement by primary key. Return nil if the
primary key is not present or if all keys that forms a primary key are not
present in the map.
sourceraw docstring

generate-whereclj

(generate-where amap)
source

get-best-alternate-keyclj

(get-best-alternate-key db table)
source

get-columnsclj

(get-columns db table)

Return a list of column names from the given table. If you call it too much it might be slow, if you memoize it your code can become out of sync with the db. Use it wisely.

Return a list of column names from the given table.
If you call it too much it might be slow, if you memoize it your code can
become out of sync with the db. Use it wisely.
sourceraw docstring

get-primary-keysclj

(get-primary-keys db table)
source

include-keys?clj

(include-keys? aset amap)

State if all the keys in a set are present in the keyset of a map

State if all the keys in a set are present in the keyset of a map
sourceraw docstring

keywordizeclj

(keywordize amap)
source

maps->table-rowsclj

(maps->table-rows db table coll)

Coerce a coll of map to a coll of rows. A map is an open set of key/values where keys can be namespaced keywords. A row is a closed set of key/values where keys are unnamespaced strings matching column names of the given table in db. Given a Users table of (id, age) in database, a given table of value :users and a coll of [{:user/id 1, :user/age 42, :project/id 2}], will produce ({'id' 1, 'age' 42}).

Coerce a coll of map to a coll of rows. A map is an open set of key/values
where keys can be namespaced keywords. A row is a closed set of key/values
where keys are unnamespaced strings matching column names of the given `table`
in `db`. Given a `Users` table of (id, age) in database, a given `table` of
value :users and a coll of [{:user/id 1, :user/age 42, :project/id 2}], will
produce ({'id' 1, 'age' 42}).
sourceraw docstring

pullq->selectclj

(pullq->select pullq)
source

pure-dbclj

(pure-db db-or-t)

Return a db-spec on which we can extract metadata, be it a simple db map or a transaction map.

Return a db-spec on which we can extract metadata, be it a simple db map or a
transaction map.
sourceraw docstring

restrict-map-to-columnsclj

(restrict-map-to-columns columns amap)

Keep only keys in the map that appears in the table in database

Keep only keys in the map that appears in the table in database
sourceraw docstring

sql-valuesclj

(sql-values row)
source

stringify-keysclj

(stringify-keys amap)

Transform keys of a map to string, drop namespaces. Since namespace is droped, later occurence of a key name will take precedence. Eg: {:foo/a 1, :bar/a 2} -> {"a" 2}

Transform keys of a map to string, drop namespaces. Since namespace is droped,
later occurence of a key name will take precedence.
Eg: {:foo/a 1, :bar/a 2} -> {"a" 2}
sourceraw docstring

table-nameclj

(table-name named)
source

table-restrictorclj

(table-restrictor db table)
source

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

× close