clj-r2dbc.row
Public row and parameter namespace for clj-r2dbc.
Separates the write path (binding params) from the read path (building row
maps). Builders are passed as :builder to execute, stream, and related
functions. Extend Parameter to bind custom types onto R2DBC statements.
Parameter binding:
Parameter - protocol; extend to bind custom types onto a Statement.
Row builders (pass as :builder to execute/stream):
kebab-maps - unqualified kebab-case keyword maps (default).
raw-maps - unqualified keyword maps, no case conversion.
vectors - plain vectors in column order.
->qualified-kebab-maps - factory; returns a qualified kebab-case builder.
->qualified-maps - factory; returns a qualified raw-name builder.
->qualified-kebab-maps
added in 0.1
(->qualified-kebab-maps & {:as opts})
Return a builder function that produces qualified kebab-case keyword maps.
The `->` prefix signals this is a factory: it takes opts and returns a
2-arity builder function [row row-metadata] -> map. Call it once at
setup time; pass the result as :builder.
Accepts a map, keyword arguments, or both:
(->qualified-kebab-maps {:qualifier :users})
(->qualified-kebab-maps :qualifier :users)
Required keys:
:qualifier String, keyword, or symbol used as the namespace.
May also be a function of [column-name column-metadata] -> namespace-string.->qualified-maps
added in 0.1
(->qualified-maps & {:as opts})
Return a builder function that produces qualified keyword maps using raw column names.
Accepts a map, keyword arguments, or both:
(->qualified-maps {:qualifier :users})
(->qualified-maps :qualifier :users)
Required keys:
:qualifier String, keyword, or symbol used as the namespace.kebab-maps
added in 0.1
Build unqualified kebab-case keyword maps.
Column names are converted to kebab-case via camel-snake-kebab.
This is the default builder for all clj-r2dbc operations.
Parameter
protocol
Write-path extensibility: bind a value onto an R2DBC Statement at index.
Extend this protocol to bind custom types that R2DBC drivers don't handle
natively.
members
-bind
(-bind this stmt index)
Bind this value onto stmt at zero-based index.
Args:
this - the value to bind.
stmt - R2DBC Statement receiving the binding.
index - zero-based integer column index.
Returns stmt.
raw-maps
added in 0.1
Build unqualified keyword maps using raw column names.
No case conversion.
vectors
added in 0.1
Build vectors in column order.
Each row is a vector of column values in result-set order.