Liking cljdoc? Tell your friends :D

shadow.pgsql


as-queryclj

(as-query db args)

as-statementclj

(as-statement db args)

build-typesclj

(build-types type-map table-naming column-naming)
(build-types type-registry type-map table-naming column-naming)

ConnectionScopecljprotocol

-get-connectionclj

(-get-connection _)

-with-connectionclj

(-with-connection _ task-fn)

create-insert-sqlclj

(create-insert-sql {:keys [types column-naming table-naming] :as db}
                   {:keys [table columns returning] :as spec})

create-update-sqlclj

(create-update-sql {:keys [types table-naming column-naming] :as db}
                   {:keys [table columns where where-params] :as spec})

date-typeclj


defquerycljmacro

(defquery name sql & kv)

edn-typeclj

(edn-type)
(edn-type edn-opts)

executeclj

(execute db stmt)
(execute db stmt params)

get-connectionclj

(get-connection db)

hstore-keyword-typeclj


hstore-string-typeclj


insertclj

(insert db spec data)

insert-oneclj

(insert-one db stmt data)

insert-one!clj

(insert-one! db table data)
(insert-one! db table data return-column)

shorthand for insert-one, but potential DANGER!

don't use with maps you got from an untrusted source will insert all values contained in the data map

if you expect {:user "name" :password "me"} but the user sends you {:user "name" :password "me" :admin true} you might run into trouble

use insert-one and specify {:columns [:user :password]} if you want to be safe.

(sql/insert-one! db :table data) returns nil (sql/insert-one! db :table data :id) returns the id of the inserted row (sql/insert-one! db :table data [:id]) returns the data merged with the resulting map {:id ...}

shorthand for insert-one, but potential DANGER!

don't use with maps you got from an untrusted source
will insert all values contained in the data map

if you expect
{:user "name" :password "me"}
but the user sends you
{:user "name" :password "me" :admin true}
you might run into trouble

use insert-one and specify {:columns [:user :password]} if you want to be safe.

(sql/insert-one! db :table data) returns nil
(sql/insert-one! db :table data :id) returns the id of the inserted row
(sql/insert-one! db :table data [:id]) returns the data merged with the resulting map {:id ...}
raw docstring

int-set-typeclj


int-typeclj


int-vec-typeclj


int2-typeclj


int2-vec-typeclj


int4-set-typeclj


int4-typeclj


int4-vec-typeclj


int8-set-typeclj


int8-typeclj


int8-vec-typeclj


keyword-set-typeclj


keyword-typeclj

stores keywords as-is

stores keywords as-is
raw docstring

keyword-vec-typeclj


legacy-keyword-typeclj

stores keywords without leading ":"

stores keywords without leading ":"
raw docstring

long-set-typeclj


long-typeclj


long-vec-typeclj


Namingcljprotocol

from-sql-nameclj

(from-sql-name this string)

to-sql-nameclj

(to-sql-name this value)

nowclj

(now)

numeric-typeclj


numeric-vec-typeclj


prepareclj

(prepare db stmt)

prepare-insertclj

(prepare-insert db spec)

prepare-queryclj

(prepare-query db stmt)

prepare-updateclj

(prepare-update db spec)

queryclj

(query db q)
(query db query params)

result->mapclj

(result->map key-fn)
(result->map key-fn value-fn)
(result->map key-fn value-fn init)

{:sql "SELECT * FROM something" :result (sql/result->map :id)}

will return {id1 row1, id2 row2, ...}

{:sql "SELECT key, value FROM something" :result (sql/result->map :key :value)}

returns {key1 value1, key2, value2, ...}

{:sql "SELECT * FROM something"
 :result (sql/result->map :id)}

will return {id1 row1, id2 row2, ...}

{:sql "SELECT key, value FROM something"
 :result (sql/result->map :key :value)}

returns {key1 value1, key2, value2, ...}
raw docstring

result->one-rowclj

result is return as nil or row

result is return as nil or row
raw docstring

result->vecclj


row->mapclj


row->map-transformclj

(row->map-transform transform-fn)

returns row as map after calling (transform-fn map)

returns row as map after calling (transform-fn map)
raw docstring

row->one-columnclj

row is returned as the value of the first (only) column

row is returned as the value of the first (only) column
raw docstring

set-typeclj

(set-type item-type)
(set-type item-type requires-quoting)

short-typeclj


startclj

(start {:keys [host port user database ssl ssl-context ssl-verify-hostname
               auth-handler connect-params connect-timeout-ms no-schema pool
               table-naming column-naming types metric-registry
               metric-collector]
        :or {host "localhost"
             port 5432
             table-naming (DefaultNaming.)
             column-naming (DefaultNaming.)
             types TypeRegistry/DEFAULT}
        :as opts})

stopclj

(stop db)

text-typeclj


text-vec-typeclj


timestamp-typeclj


timestamp-vec-typeclj


timestamptz-typeclj


timestamptz-vec-typeclj


update!clj

(update! db table data)
(update! {:keys [table-naming column-naming types] :as db}
         table
         data
         where
         params)

(sql/update! db :table {:column value, ...} "id = $1" [id]) this is also potentially dangerous since all columns are updated

(sql/update! db :table {:column value, ...} "id = $1" [id])
this is also potentially dangerous since all columns are updated
raw docstring

vec-typeclj

(vec-type item-type)
(vec-type item-type requires-quoting)

with-connectioncljmacro

(with-connection db & body)

with-dashesclj

(with-dashes x)

with-default-typesclj

(with-default-types db & handlers)

with-transactioncljmacro

(with-transaction db & body)

with-typesclj

(with-types {:keys [table-naming column-naming] :as db} type-map)

copy db instance with custom type handlers {table-name {column-name type-handler}} types can also be declared per query

copy db instance with custom type handlers {table-name {column-name type-handler}}
types can also be declared per query
raw docstring

with-underscoresclj

(with-underscores x)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close