(catch-jdbc body)(catch-jdbc statement-context body & more-body)Evaluates body within a try/catch block, converting any thrown Throwable
into a typed :jdbc/error failure.
Evaluates `body` within a try/catch block, converting any thrown `Throwable` into a typed `:jdbc/error` failure.
(close-connection> conn)Creates an effect closing an AutoCloseable connection or statement.
Creates an effect closing an `AutoCloseable` connection or statement.
(execute!> sql-params)(execute!> a b)(execute!> connectable sql-params opts)Executes a SQL statement returning a vector of row maps or update counts.
Supports explicit connectable or context-resolved ::datasource.
Executes a SQL statement returning a vector of row maps or update counts. Supports explicit connectable or context-resolved `::datasource`.
(execute-one!> sql-params)(execute-one!> a b)(execute-one!> connectable sql-params opts)Executes a SQL statement returning the first row map or nil.
Supports explicit connectable or context-resolved ::datasource.
Executes a SQL statement returning the first row map or `nil`. Supports explicit connectable or context-resolved `::datasource`.
(get-connection>)(get-connection> connectable)(get-connection> connectable opts)Creates an effect acquiring a java.sql.Connection from connectable (or ::datasource in context).
Creates an effect acquiring a `java.sql.Connection` from `connectable` (or ::datasource in context).
(get-datasource> db-spec)Creates an effect yielding a javax.sql.DataSource from a db-spec map or string.
Creates an effect yielding a `javax.sql.DataSource` from a db-spec map or string.
(jdbc-error e)(jdbc-error e statement)Constructs a typed failure with tag :jdbc/error capturing SQLState, error codes,
and optional statement context.
Constructs a typed failure with tag `:jdbc/error` capturing SQLState, error codes, and optional statement context.
(missing-connectable-error)Constructs a typed failure when no connectable is supplied and ::datasource is absent in context.
Constructs a typed failure when no connectable is supplied and ::datasource is absent in context.
(plan!> sql-params reduce-fn initial-acc)(plan!> a b c d)(plan!> connectable sql-params opts reduce-fn initial-acc)Executes a streaming lazy reduction over SQL results via next.jdbc/plan.
Evaluates (reduce reduce-fn initial-acc (next.jdbc/plan ...)) inside the effect.
Executes a streaming lazy reduction over SQL results via `next.jdbc/plan`. Evaluates `(reduce reduce-fn initial-acc (next.jdbc/plan ...))` inside the effect.
(prepare-statement> sql-params)(prepare-statement> a b)(prepare-statement> connectable sql-params opts)Creates an effect preparing a java.sql.PreparedStatement from connectable (or ::datasource in context).
Creates an effect preparing a `java.sql.PreparedStatement` from `connectable` (or ::datasource in context).
(with-connection> use-eff-fn)(with-connection> connectable use-eff-fn)(with-connection> connectable opts use-eff-fn)Executes use-eff-fn within a scoped connection, ensuring deterministic close
and dynamically binding ::datasource in context.
Executes `use-eff-fn` within a scoped connection, ensuring deterministic close and dynamically binding ::datasource in context.
(with-prepared-statement> sql-params use-eff-fn)(with-prepared-statement> a b c)(with-prepared-statement> connectable sql-params opts use-eff-fn)Prepares a statement, executes use-eff-fn with the prepared statement, and guarantees closure.
Prepares a statement, executes `use-eff-fn` with the prepared statement, and guarantees closure.
(with-transaction> tx-eff-fn)(with-transaction> a b)(with-transaction> connectable opts tx-eff-fn)Executes tx-eff-fn within a JDBC transaction boundary.
Automatically commits on effect success, and rolls back if the inner effect
evaluates to an IFailure OR throws an exception.
Supports transaction options: :isolation, :read-only, and :rollback-only.
Executes `tx-eff-fn` within a JDBC transaction boundary. Automatically commits on effect success, and rolls back if the inner effect evaluates to an `IFailure` OR throws an exception. Supports transaction options: `:isolation`, `:read-only`, and `:rollback-only`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |