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.
(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"
(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.
(with-connection [connection-binding connectable] & body)
(with-connection [connection-binding connectable] & body)
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close