Liking cljdoc? Tell your friends :D

shadow.pgsql


as-queryclj

(as-query db args)
source

as-statementclj

(as-statement db args)
source

build-typesclj

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

ConnectionScopecljprotocol

-get-connectionclj

(-get-connection _)

-with-connectionclj

(-with-connection _ task-fn)
source

create-insert-sqlclj

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

create-update-sqlclj

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

date-typeclj

source

defquerycljmacro

(defquery name sql & kv)
source

edn-typeclj

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

executeclj

(execute db stmt)
(execute db stmt params)
source

get-connectionclj

(get-connection db)
source

hstore-keyword-typeclj

source

hstore-string-typeclj

source

insertclj

(insert db spec data)
source

insert-oneclj

(insert-one db stmt data)
source

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 the inserted data (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 the inserted data
(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 ...}
sourceraw docstring

int-set-typeclj

source

int-typeclj

source

int-vec-typeclj

source

int2-typeclj

source

int2-vec-typeclj

source

int4-set-typeclj

source

int4-typeclj

source

int4-vec-typeclj

source

int8-set-typeclj

source

int8-typeclj

source

int8-vec-typeclj

source

keyword-set-typeclj

source

keyword-typeclj

stores keywords as-is

stores keywords as-is
sourceraw docstring

keyword-vec-typeclj

source

legacy-keyword-typeclj

stores keywords without leading ":"

stores keywords without leading ":"
sourceraw docstring

long-set-typeclj

source

long-typeclj

source

long-vec-typeclj

source

Namingcljprotocol

from-sql-nameclj

(from-sql-name this string)

to-sql-nameclj

(to-sql-name this value)
source

nowclj

(now)
source

numeric-typeclj

source

numeric-vec-typeclj

source

prepareclj

(prepare db stmt)
source

prepare-insertclj

(prepare-insert db spec)
source

prepare-queryclj

(prepare-query db stmt)
source

prepare-updateclj

(prepare-update db spec)
source

queryclj

(query db q)
(query db query params)
source

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, ...}
sourceraw docstring

result->one-rowclj

result is return as nil or row

result is return as nil or row
sourceraw docstring

result->vecclj

source

row->mapclj

source

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)
sourceraw 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
sourceraw docstring

set-typeclj

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

short-typeclj

source

startclj

(start {:keys [host port user database 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})
source

stopclj

(stop db)
source

text-typeclj

source

text-vec-typeclj

source

timestamp-typeclj

source

timestamp-vec-typeclj

source

timestamptz-typeclj

source

timestamptz-vec-typeclj

source

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
sourceraw docstring

vec-typeclj

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

with-connectioncljmacro

(with-connection db & body)
source

with-dashesclj

(with-dashes x)
source

with-default-typesclj

(with-default-types db & handlers)
source

with-transactioncljmacro

(with-transaction db & body)
source

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
sourceraw docstring

with-underscoresclj

(with-underscores x)
source

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

× close