How to format column name Caution! (->snake_case "foo1") => foo_1
How to format column name Caution! (->snake_case "foo1") => foo_1
How to format table name Caution! (->snake_case "foo1") => foo_1
How to format table name Caution! (->snake_case "foo1") => foo_1
How to format columns Caution! (->kebab-case "foo1") => foo-1
How to format columns Caution! (->kebab-case "foo1") => foo-1
How to make sqlvec You may want to change it to formatting sql function that a sql library provides
How to make sqlvec You may want to change it to formatting sql function that a sql library provides
(copy-in ds table columns values)
Inputs: [ds table columns values] Returns: s/Int
Use COPY FROM STDIN for very fast copying from a Reader into a database table
ds - implements next.jdbc.protocols/Sourceable or connection table - table name. e.g. :my-data columns - column names. e.g. [:foo :bar :baz] values - java.io.Reader, java.io.InputStream, String or sequence of sequences which represents CSV data like [[1 "abc" "def"]]
Inputs: [ds table columns values] Returns: s/Int Use COPY FROM STDIN for very fast copying from a Reader into a database table ds - implements next.jdbc.protocols/Sourceable or connection table - table name. e.g. :my-data columns - column names. e.g. [:foo :bar :baz] values - java.io.Reader, java.io.InputStream, String or sequence of sequences which represents CSV data like [[1 "abc" "def"]]
(execute ds sql)
(execute ds sql opts)
Inputs: ([ds sql] [ds sql opts]) Returns: [#:s{Keyword s/Any}]
execute insert, update or delete query and get all effected rows as a sequence of map
See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
Inputs: ([ds sql] [ds sql opts]) Returns: [#:s{Keyword s/Any}] execute insert, update or delete query and get all effected rows as a sequence of map See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
(execute-batch ds sql)
(execute-batch ds sql opts)
Inputs: ([ds sql] [ds sql opts]) Returns: (s/maybe s/Int)
execute insert, update or delete query and get the effected number
See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
Inputs: ([ds sql] [ds sql opts]) Returns: (s/maybe s/Int) execute insert, update or delete query and get the effected number See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
(execute-one ds sql)
(execute-one ds sql opts)
Inputs: ([ds sql] [ds sql opts]) Returns: (s/maybe #:s{Keyword s/Any})
execute insert, update or delete query and get a first row as a map
See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
Inputs: ([ds sql] [ds sql opts]) Returns: (s/maybe #:s{Keyword s/Any}) execute insert, update or delete query and get a first row as a map See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
(fetch ds sql)
(fetch ds sql opts)
Inputs: ([ds sql] [ds sql opts])
execute select query and get all result rows as a sequence of map
See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
Inputs: ([ds sql] [ds sql opts]) execute select query and get all result rows as a sequence of map See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
(fetch-one ds sql)
(fetch-one ds sql opts)
Inputs: ([ds sql] [ds sql opts])
execute select query and get a first row as a map
See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
Inputs: ([ds sql] [ds sql opts]) execute select query and get a first row as a map See for opts https://github.com/seancorfield/next-jdbc/blob/master/doc/all-the-options.md
(with-db-transaction [sym transactable opts] & body)
It is almost same as with-transaction but it supports nested transaction.
Like clojure.java.jdbc/with-db-transaction when two or more with-db-transaction are nested, we want to rollback to top-level with-db-transaction. We know we should use {:auto-commit false} and save points but it enables us to migrate to next.jdbc easily
It is almost same as with-transaction but it supports nested transaction. Like clojure.java.jdbc/with-db-transaction when two or more with-db-transaction are nested, we want to rollback to top-level with-db-transaction. We know we should use {:auto-commit false} and save points but it enables us to migrate to next.jdbc easily
(with-transaction [sym transactable opts] & body)
This macro is completely same as the next.jdbc/with-transaction. It's copied in order that clients can only require this ns for DB access.
===Original doc===
Given a transactable object, gets a connection and binds it to sym
,
then executes the body
in that context, committing any changes if the body
completes successfully, otherwise rolling back any changes made.
The options map supports:
:isolation
-- :none
, :read-committed
, :read-uncommitted
,
:repeatable-read
, :serializable
,:read-only
-- true
/ false
,:rollback-only
-- true
/ false
.
===================This macro is completely same as the next.jdbc/with-transaction. It's copied in order that clients can only require this ns for DB access. ===Original doc=== Given a transactable object, gets a connection and binds it to `sym`, then executes the `body` in that context, committing any changes if the body completes successfully, otherwise rolling back any changes made. The options map supports: * `:isolation` -- `:none`, `:read-committed`, `:read-uncommitted`, `:repeatable-read`, `:serializable`, * `:read-only` -- `true` / `false`, * `:rollback-only` -- `true` / `false`. ===================
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close