clj-r2dbc.impl.protocols
Protocol definitions for facade dispatch.
These protocols form the dispatch layer separating the public API
(clj-r2dbc) from driver implementations. JVM interface dispatch
replaces delay/requiring-resolve indirection with zero overhead.
Protocols and their dispatch types:
Executable - extended to ConnectionFactory, Connection, ConnectableWithOpts.
Covers execute, execute-one, execute-each, execute-batch.
Streamable - extended to ConnectionFactory, Connection, ConnectableWithOpts.
Covers stream.
Connectable - extended to ConnectionFactory, Connection, ConnectableWithOpts.
Covers with-connection, with-options.
Describable - extended to Connection only.
Covers connection-metadata.
This namespace contains only protocol definitions - no logic, no imports,
no side effects.Connectable
protocol
Dispatch protocol for connection acquisition and option attachment.
Extended by ConnectionFactory, Connection, and ConnectableWithOpts.
members
-with-connection
(-with-connection db body-fn)
Acquire a connection, call body-fn with it, and guarantee connection close.
-with-options
(-with-options db opts)
Return a new connectable wrapping db with opts merged as defaults.
Describable
protocol
Dispatch protocol for connection metadata retrieval.
Extended by Connection.
Executable
protocol
Dispatch protocol for SQL execution.
Extended by ConnectionFactory, Connection, and ConnectableWithOpts.
members
-execute
(-execute db sql params opts)
Execute sql against db and return the full labeled result map.
-execute-batch
(-execute-batch db statements opts)
Execute multiple SQL statements in a single round trip and return a batch result map.
-execute-each
(-execute-each db sql param-sets opts)
Execute sql once per param-set in param-sets and return a per-binding-set result vector.
-execute-one
(-execute-one db sql params opts)
Execute sql against db and return the first row or nil.
Streamable
protocol
Dispatch protocol for streaming row execution.
Extended by ConnectionFactory, Connection, and ConnectableWithOpts.
members
-stream
(-stream db sql params opts)
Return a Missionary discrete flow emitting one row value per item.