Liking cljdoc? Tell your friends :D

next.jdbc.result-set

An implementation of ResultSet handling functions.

Defines the following protocols:

  • DatafiableRow -- for turning a row into something datafiable
  • ReadableColumn -- to read column values by label or index
  • RowBuilder -- for materializing a row
  • ResultSetBuilder -- for materializing a result set

Also provides the default implemenations for Executable and the default datafy/nav behavior for rows from a result set.

An implementation of `ResultSet` handling functions.

Defines the following protocols:
* `DatafiableRow` -- for turning a row into something datafiable
* `ReadableColumn` -- to read column values by label or index
* `RowBuilder` -- for materializing a row
* `ResultSetBuilder` -- for materializing a result set

Also provides the default implemenations for `Executable` and
the default `datafy`/`nav` behavior for rows from a result set.

as-arrays

(as-arrays rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces a vector of column names followed by vectors of row values.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces a vector of column names followed by vectors of row values.
sourceraw docstring

as-lower-arrays

(as-lower-arrays rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces a vector of lower-case column names followed by vectors of row values.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces a vector of lower-case column names followed by vectors of
row values.
sourceraw docstring

as-lower-maps

(as-lower-maps rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces bare vectors of hash map rows, with lower-case keys.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces bare vectors of hash map rows, with lower-case keys.
sourceraw docstring

as-maps

(as-maps rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces bare vectors of hash map rows.

This is the default :builder-fn option.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces bare vectors of hash map rows.

This is the default `:builder-fn` option.
sourceraw docstring

as-modified-arrays

(as-modified-arrays rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces a vector of modified column names followed by vectors of row values.

Requires both the :qualifier-fn and :label-fn options.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces a vector of modified column names followed by vectors of
row values.

Requires both the `:qualifier-fn` and `:label-fn` options.
sourceraw docstring

as-modified-maps

(as-modified-maps rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces bare vectors of hash map rows, with modified keys.

Requires both the :qualifier-fn and :label-fn options.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces bare vectors of hash map rows, with modified keys.

Requires both the `:qualifier-fn` and `:label-fn` options.
sourceraw docstring

as-unqualified-arrays

(as-unqualified-arrays rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces a vector of simple column names followed by vectors of row values.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces a vector of simple column names followed by vectors of row
values.
sourceraw docstring

as-unqualified-lower-arrays

(as-unqualified-lower-arrays rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces a vector of simple, lower-case column names followed by vectors of row values.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces a vector of simple, lower-case column names followed by
vectors of row values.
sourceraw docstring

as-unqualified-lower-maps

(as-unqualified-lower-maps rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces bare vectors of hash map rows, with simple, lower-case keys.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces bare vectors of hash map rows, with simple, lower-case keys.
sourceraw docstring

as-unqualified-maps

(as-unqualified-maps rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces bare vectors of hash map rows, with simple keys.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces bare vectors of hash map rows, with simple keys.
sourceraw docstring

as-unqualified-modified-arrays

(as-unqualified-modified-arrays rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces a vector of simple, modified column names followed by vectors of row values.

Requires the :label-fn option.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces a vector of simple, modified column names followed by
vectors of row values.

Requires the `:label-fn` option.
sourceraw docstring

as-unqualified-modified-maps

(as-unqualified-modified-maps rs opts)

Given a ResultSet and options, return a RowBuilder / ResultSetBuilder that produces bare vectors of hash map rows, with simple, modified keys.

Requires the :label-fn option.

Given a `ResultSet` and options, return a `RowBuilder` / `ResultSetBuilder`
that produces bare vectors of hash map rows, with simple, modified keys.

Requires the `:label-fn` option.
sourceraw docstring

DatafiableRowprotocol

Protocol for making rows datafiable and therefore navigable.

The default implementation just adds metadata so that datafy can be called on the row, which will produce something that nav can be called on, to lazily navigate through foreign key relationships into other tables.

If datafiable-row is called when reducing the result set produced by next.jdbc/plan, the row is fully-realized from the ResultSet first.

Protocol for making rows datafiable and therefore navigable.

The default implementation just adds metadata so that `datafy` can be
called on the row, which will produce something that `nav` can be called
on, to lazily navigate through foreign key relationships into other tables.

If `datafiable-row` is called when reducing the result set produced by
`next.jdbc/plan`, the row is fully-realized from the `ResultSet`
first.
datafiable-row
(datafiable-row this connectable opts)

Produce a datafiable representation of a row from a ResultSet.

Produce a datafiable representation of a row from a `ResultSet`.

sourceraw docstring

get-column-names

(get-column-names rsmeta opts)

Given ResultSetMetaData, return a vector of column names, each qualified by the table from which it came.

Given `ResultSetMetaData`, return a vector of column names, each qualified by
the table from which it came.
sourceraw docstring

get-lower-column-names

(get-lower-column-names rsmeta opts)

Given ResultSetMetaData, return a vector of lower-case column names, each qualified by the table from which it came.

Given `ResultSetMetaData`, return a vector of lower-case column names, each
qualified by the table from which it came.
sourceraw docstring

get-modified-column-names

(get-modified-column-names rsmeta opts)

Given ResultSetMetaData, return a vector of modified column names, each qualified by the table from which it came.

Requires both the :qualifier-fn and :label-fn options.

Given `ResultSetMetaData`, return a vector of modified column names, each
qualified by the table from which it came.

Requires both the `:qualifier-fn` and `:label-fn` options.
sourceraw docstring

get-unqualified-column-names

(get-unqualified-column-names rsmeta opts)

Given ResultSetMetaData, return a vector of unqualified column names.

Given `ResultSetMetaData`, return a vector of unqualified column names.
sourceraw docstring

get-unqualified-lower-column-names

(get-unqualified-lower-column-names rsmeta opts)

Given ResultSetMetaData, return a vector of unqualified column names.

Given `ResultSetMetaData`, return a vector of unqualified column names.
sourceraw docstring

get-unqualified-modified-column-names

(get-unqualified-modified-column-names rsmeta opts)

Given ResultSetMetaData, return a vector of unqualified modified column names.

Requires the :label-fn option.

Given `ResultSetMetaData`, return a vector of unqualified modified column
names.

Requires the `:label-fn` option.
sourceraw docstring

ReadableColumnprotocol

Protocol for reading objects from the java.sql.ResultSet. Default implementations (for Object and nil) return the argument, and the Boolean implementation ensures a canonicalized true/false value, but it can be extended to provide custom behavior for special types.

Protocol for reading objects from the `java.sql.ResultSet`. Default
implementations (for `Object` and `nil`) return the argument, and the
`Boolean` implementation ensures a canonicalized `true`/`false` value,
but it can be extended to provide custom behavior for special types.
read-column-by-index
(read-column-by-index val rsmeta idx)

Function for transforming values after reading them via a column index.

Function for transforming values after reading them via a column index.

read-column-by-label
(read-column-by-label val label)

Function for transforming values after reading them via a column label.

Function for transforming values after reading them via a column label.

sourceraw docstring

ResultSetBuilderprotocol

Protocol for building result sets in various representations.

Default implementations for building vectors of hash maps and vectors of column names and row values: MapResultSetBuilder & ArrayResultSetBuilder

Protocol for building result sets in various representations.

Default implementations for building vectors of hash maps and vectors of
column names and row values: `MapResultSetBuilder` & `ArrayResultSetBuilder`
->rs
(->rs _)

Called to create the basis of the result set.

Called to create the basis of the result set.

rs!
(rs! _ rs)

Called to finalize the result set once it is complete.

Called to finalize the result set once it is complete.

with-row
(with-row _ rs row)

Called with the result set and the row to be added.

Called with the result set and the row to be added.

sourceraw docstring

RowBuilderprotocol

Protocol for building rows in various representations.

The default implementation for building hash maps: MapResultSetBuilder

Protocol for building rows in various representations.

The default implementation for building hash maps: `MapResultSetBuilder`
->row
(->row _)

Called once per row to create the basis of each row.

Called once per row to create the basis of each row.

column-count
(column-count _)

Return the number of columns in each row.

Return the number of columns in each row.

row!
(row! _ row)

Called once per row to finalize each row once it is complete.

Called once per row to finalize each row once it is complete.

with-column
(with-column _ row i)

Called with the row and the index of the column to be added; this is expected to read the column value from the ResultSet!

Called with the row and the index of the column to be added;
this is expected to read the column value from the `ResultSet`!

sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close