Liking cljdoc? Tell your friends :D

toyokumo.commons.db


*format-column*clj

How to format column name Caution! (->snake_case "foo1") => foo_1

How to format column name
Caution!
  (->snake_case "foo1") => foo_1
sourceraw docstring

*format-table*clj

How to format table name Caution! (->snake_case "foo1") => foo_1

How to format table name
Caution!
  (->snake_case "foo1") => foo_1
sourceraw docstring

*label-fn*clj

How to format columns Caution! (->kebab-case "foo1") => foo-1

How to format columns
Caution!
  (->kebab-case "foo1") => foo-1
sourceraw docstring

*make-sqlvec*clj

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

copy-inclj

(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"]]
sourceraw docstring

executeclj

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

execute-batchclj

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

execute-oneclj

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

fetchclj

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

fetch-oneclj

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

transact-onceclj

(transact-once tx f opts)
source

with-db-transactioncljmacro

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

with-transactioncljmacro

(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`.
===================
sourceraw docstring

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

× close