(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])
(execute-update cn sql)
Returns number of rows affected
Returns number of rows affected
(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.
Removes all entries from input map where the value is nil.
Removes all entries from input map where the value is nil.
Returns a result set standardized by idealize-row
Returns a result set standardized by idealize-row
(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.
(insert-multi! db table rows)
(insert-multi! db table rows batch-size)
Batch inserts
Batch inserts
(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.
(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.
(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!
(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.
(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])
(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.
(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
(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])
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close