Liking cljdoc? Tell your friends :D

toucan2.connection


*current-connectable*clj

The current connectable or connection. If you get a connection with with-connection or with-transaction, it will be bound here. You can also bind this yourself to a connectable or connection, and Toucan methods called without an explicit will connectable will use it rather than the :default connection.

The current connectable or connection. If you get a connection with [[with-connection]] or [[with-transaction]], it
will be bound here. You can also bind this yourself to a connectable or connection, and Toucan methods called without
an explicit will connectable will use it rather than the `:default` connection.
sourceraw docstring

connection-string-protocolclj

(connection-string-protocol connection-string)

Extract the protocol part of a connection-string.

(connection-string-protocol "jdbc:postgresql:...") => "jdbc"

Extract the protocol part of a `connection-string`.

(connection-string-protocol "jdbc:postgresql:...")
=>
"jdbc"
sourceraw docstring

do-with-connectionclj

(do-with-connection connectable₁ f)
source

do-with-connection-stringclj

(do-with-connection-string connection-string f)
source

do-with-transactionclj

(do-with-transaction connection₁ options f)

options are options for determining what type of transaction we'll get. See dox for with-transaction for more information.

`options` are options for determining what type of transaction we'll get. See dox for [[with-transaction]] for more
information.
sourceraw docstring

with-connectioncljmacro

(with-connection [connection-binding connectable] & body)
(with-connection [connection-binding connectable] & body)
source

with-transactioncljmacro

(with-transaction [conn-binding connectable options?] & body)

Gets a connection with with-connection, and executes body within that transaction.

An options map, if specified, determine what sort of transaction we're asking for (stuff like the read isolation level and what not). One key, :nested-transaction-rule, is handled directly in Toucan 2; other options are passed directly to the underlying implementation, such as [[next.jdbc.transaction]].

:nested-transaction-rule must be one of #{:allow :ignore :prohibit}, a set of possibilities shamelessly borrowed from next.jdbc. For non-JDBC implementations, you should treat :allow as the default behavior if unspecified.

Gets a connection with [[with-connection]], and executes `body` within that transaction.

An `options` map, if specified, determine what sort of transaction we're asking for (stuff like the read isolation
level and what not). One key, `:nested-transaction-rule`, is handled directly in Toucan 2; other options are passed
directly to the underlying implementation, such as [[next.jdbc.transaction]].

`:nested-transaction-rule` must be one of `#{:allow :ignore :prohibit}`, a set of possibilities shamelessly borrowed
from `next.jdbc`. For non-JDBC implementations, you should treat `:allow` as the default behavior if unspecified.
sourceraw docstring

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

× close