(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 ::connection / ::datasource.
Executes a SQL statement returning a vector of row maps or update counts. Supports explicit connectable or context-resolved `::connection` / `::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 ::connection / ::datasource.
Executes a SQL statement returning the first row map or `nil`. Supports explicit connectable or context-resolved `::connection` / `::datasource`.
(get-connection>)(get-connection> connectable)(get-connection> connectable opts)Creates an effect acquiring a java.sql.Connection from connectable (or ::connection / ::datasource in context).
Creates an effect acquiring a `java.sql.Connection` from `connectable` (or ::connection / ::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-failure e)(jdbc-failure 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-failure)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.
Supports explicit connectable or context-resolved ::connection / ::datasource.
Executes a streaming lazy reduction over SQL results via `next.jdbc/plan`. Evaluates `(reduce reduce-fn initial-acc (next.jdbc/plan ...))` inside the effect. Supports explicit connectable or context-resolved `::connection` / `::datasource`.
(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 ::connection / ::datasource in context).
Creates an effect preparing a `java.sql.PreparedStatement` from `connectable` (or ::connection / ::datasource in context).
(provide-connection> conn)(provide-connection> a b)Executes eff within a dynamic context where ::connection is bound to conn.
Supports point-free pipeline threading and standalone wrapping:
(-> (sql/query!> ["SELECT * FROM users"])
(fx-jdbc/provide-connection> conn))
(fx-jdbc/provide-connection> conn eff)
Executes `eff` within a dynamic context where `::connection` is bound to `conn`.
Supports point-free pipeline threading and standalone wrapping:
(-> (sql/query!> ["SELECT * FROM users"])
(fx-jdbc/provide-connection> conn))
(fx-jdbc/provide-connection> conn eff)(provide-datasource> ds)(provide-datasource> a b)Executes eff within a dynamic context where ::datasource is bound to ds.
Supports point-free pipeline threading and standalone wrapping:
(-> (sql/query!> ["SELECT * FROM users"])
(fx-jdbc/provide-datasource> ds))
(fx-jdbc/provide-datasource> ds eff)
Executes `eff` within a dynamic context where `::datasource` is bound to `ds`.
Supports point-free pipeline threading and standalone wrapping:
(-> (sql/query!> ["SELECT * FROM users"])
(fx-jdbc/provide-datasource> ds))
(fx-jdbc/provide-datasource> ds eff)(provide-transaction> tx)(provide-transaction> a b)Executes eff within a dynamic context where ::transaction is bound to tx.
Supports point-free pipeline threading and standalone wrapping:
(-> (sql/insert!> :users {:name "Alice"})
(fx-jdbc/provide-transaction> tx))
(fx-jdbc/provide-transaction> tx eff)
Executes `eff` within a dynamic context where `::transaction` is bound to `tx`.
Supports point-free pipeline threading and standalone wrapping:
(-> (sql/insert!> :users {:name "Alice"})
(fx-jdbc/provide-transaction> tx))
(fx-jdbc/provide-transaction> tx eff)(with-connection> eff)(with-connection> a b)(with-connection> connectable opts eff)Executes eff within a scoped connection, ensuring deterministic close
and dynamically binding ::datasource and ::connection in context.
Resolves connectable from explicit connectable, upstream value, or context.
Executes `eff` within a scoped connection, ensuring deterministic close and dynamically binding `::datasource` and `::connection` in context. Resolves connectable from explicit `connectable`, upstream value, or 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)(with-transaction> a b)(with-transaction> connectable opts tx-eff)Executes tx-eff within a JDBC transaction boundary as a higher-order effect.
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.
Connectable can be passed explicitly or resolved implicitly from context.
Executes `tx-eff` within a JDBC transaction boundary as a higher-order effect. 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`. Connectable can be passed explicitly or resolved implicitly from context.
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 |