Liking cljdoc? Tell your friends :D

e85th.commons.sql


as-clj-identifierclj

(as-clj-identifier s)
source

as-sql-identifierclj

(as-sql-identifier s)
source

clojurize-returned-rowclj

(clojurize-returned-row data)
source

default-batch-sizeclj

source

delete!clj

(delete! db table where-clause)

Delete. (sql/delete! (:db system) :schema.table-name ["id = ?" 42])

Delete. (sql/delete! (:db system) :schema.table-name ["id = ?" 42])
sourceraw docstring

execute-updateclj

(execute-update cn sql)

Returns number of rows affected

Returns number of rows affected
sourceraw docstring

execute-with-cnclj

(execute-with-cn cn sql)
source

execute-wo-txn!clj

(execute-wo-txn! db sql)

Executes statement outside of any implicit transactions. Useful in executing vacuum for example.

Executes statement outside of any implicit transactions.
Useful in executing vacuum for example.
sourceraw docstring

idealize-rowclj

Removes all entries from input map where the value is nil.

Removes all entries from input map where the value is nil.
sourceraw docstring

idealize-rsclj

Returns a result set standardized by idealize-row

Returns a result set standardized by idealize-row
sourceraw docstring

insert!clj

(insert! db table row)
(insert! db table row user-id)

Returns the inserted row as a map. When user-id is specified, created-by and updated-by fields will be assocd into the row.

Returns the inserted row as a map. When user-id is specified,
created-by and updated-by fields will be assocd into the row.
sourceraw docstring

insert-multi!clj

(insert-multi! db table rows)
(insert-multi! db table rows batch-size)

Batch inserts

Batch inserts
sourceraw docstring

insert-multi-with-audits!clj

(insert-multi-with-audits! db table rows user-id)
(insert-multi-with-audits! db table rows user-id batch-size)

Batch insert with audits.

Batch insert with audits.
sourceraw docstring

insert-multi-with-create-audits!clj

(insert-multi-with-create-audits! db table rows user-id)
(insert-multi-with-create-audits! db table rows user-id batch-size)

Batch insert with create audits.

Batch insert with create audits.
sourceraw docstring

insert-with-create-audits!clj

(insert-with-create-audits! db table row user-id)

Adds in keys :created-by to the row and calls insert!

Adds in keys :created-by to the row and calls insert!
sourceraw docstring

new-connection-poolclj

(new-connection-pool ds-opts)

Makes a new connection pool with a :datasource key. See hikari for the keys in the ds-opts map.

Makes a new connection pool with a :datasource key.
See hikari for the keys in the ds-opts map.
sourceraw docstring

queryclj

(query db sql-and-params)

Returns a seq of maps representing the result set. (sql/query* (:db system) ["select * from schema.table where id = ?" 12])

Returns a seq of maps representing the result set.
(sql/query* (:db system) ["select * from schema.table where id = ?" 12])
sourceraw docstring

query1clj

(query1 db sql-and-params)

Same as query, but removes keys with nil value. Similar to Datomic, helps with spec, so you don't have (optional) keys where the values are nilable.

Same as `query`, but removes keys with nil value. Similar to Datomic,
helps with spec, so you don't have (optional) keys where the values are nilable.
sourceraw docstring

truncate-table!clj

(truncate-table! db table)
source

unique-violation?clj

(unique-violation? ex)

Postgres unique violation for the exception? https://www.postgresql.org/docs/current/static/errcodes-appendix.html

Postgres unique violation for the exception? https://www.postgresql.org/docs/current/static/errcodes-appendix.html
sourceraw docstring

update!clj

(update! db table row where-clause)
(update! db table row where-clause user-id)
(update! db table row where-clause user-id optimistic?)

Returns count of rows updated. (sql/update! (:db system) :schema.table-name {:first-name "Mary"} ["id = ?" 42])

Returns count of rows updated.
(sql/update! (:db system) :schema.table-name {:first-name "Mary"} ["id = ?" 42])
sourceraw docstring

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

× close