Liking cljdoc? Tell your friends :D

asphalt.result


_label->keyclj

(_label->key label)

Convert given string (column) label to keyword after replacing underscores with dashes.

Convert given string (column) label to keyword after replacing underscores with dashes.
sourceraw docstring

ignore-multiclj

(ignore-multi _ _ v)

Handle asphalt.core/fetch-optional-row/value :on-multi event by returning the first value.

Handle asphalt.core/fetch-optional-row/value :on-multi event by returning the first value.
sourceraw docstring

label->keyclj

(label->key label)

Convert given string (column) label to keyword.

Convert given string (column) label to keyword.
sourceraw docstring

letcolcljmacro

(letcol binding & body)

Destructure column values in the current row in a java.sql.ResultSet instance. Optional SQL type hints increase accuracy and speed. The date, time and timestamp types accept an additional timezone-string/calendar argument.

Sequential destructuring with implicit column index lookup: (letcol [[^int foo ^string bar [^date baz cal]] result-set] ; cal is TimeZone keyword/string or java.util.Calendar [foo bar baz])

Associative destructuring with implicit column label lookup: (letcol [{:labels [^int foo ^string bar [^date baz cal]] ; cal is TimeZone keyword/string or java.util.Calendar :_labels [^date end-date ^timestamp audit-ts]]} result-set] ;; :_labels turns dash to underscore when looking up by column label: end_date, audit_ts [foo bar baz end-date audit-ts])

Associative destructuring with explicit column reference: (letcol [{^int foo 1 ; column index begins with 1 ^string bar 2 ^boolean baz 3 [^date end-date cal] "end_date" ; cal is TimeZone keyword/string or java.util.Calendar ^timestamp audit-ts "audit_ts"} result-set] [foo bar baz end-date audit-ts])

Destructure column values in the current row in a java.sql.ResultSet instance. Optional SQL type hints increase
accuracy and speed. The date, time and timestamp types accept an additional timezone-string/calendar argument.

Sequential destructuring with implicit column index lookup:
(letcol [[^int foo ^string bar [^date baz cal]] result-set]  ; cal is TimeZone keyword/string or java.util.Calendar
  [foo bar baz])

Associative destructuring with implicit column label lookup:
(letcol [{:labels  [^int foo ^string bar [^date baz cal]]    ; cal is TimeZone keyword/string or java.util.Calendar
          :_labels [^date end-date ^timestamp audit-ts]]} result-set]
  ;; :_labels turns dash to underscore when looking up by column label: end_date, audit_ts
  [foo bar baz end-date audit-ts])

Associative destructuring with explicit column reference:
(letcol [{^int       foo 1  ; column index begins with 1
          ^string    bar 2
          ^boolean   baz 3
          [^date     end-date cal] "end_date"              ; cal is TimeZone keyword/string or java.util.Calendar
          ^timestamp audit-ts "audit_ts"} result-set]
  [foo bar baz end-date audit-ts])
sourceraw docstring

make-column-value-readerclj

(make-column-value-reader result-types column-index)
(make-column-value-reader result-type column-index col-arg)

Given result column type and column index, return a type-aware, efficient value-reading function.

Given result column type and column index, return a type-aware, efficient value-reading function.
sourceraw docstring

make-columns-readerclj

(make-columns-reader result-types)
(make-columns-reader result-types col-args)

Given result column types, return a type-aware, efficient columns-reading function.

Given result column types, return a type-aware, efficient columns-reading function.
sourceraw docstring

nil-on-emptyclj

(nil-on-empty _ _)

Handle asphalt.core/fetch-optional-row/value :on-empty event by returning nil.

Handle asphalt.core/fetch-optional-row/value :on-empty event by returning nil.
sourceraw docstring

read-column-valueclj

(read-column-value result-set column-index)
(read-column-value column-type result-set column-index)
(read-column-value column-type column-arg result-set column-index)

Read column value from java.sql.ResultSet at the specified column index and return it.

Read column value from java.sql.ResultSet at the specified column index and return it.
sourceraw docstring

read-columnsclj

(read-columns result-set column-count)
(read-columns column-types result-set column-count)
(read-columns column-types column-args result-set column-count)

Read the column values from given java.sql.ResultSet and return as a vector.

Read the column values from given java.sql.ResultSet and return as a vector.
sourceraw docstring

throw-on-emptyclj

(throw-on-empty sql-source result-set)

Handle :on-empty event in fetch fns by throwing exception.

Handle :on-empty event in fetch fns by throwing exception.
sourceraw docstring

throw-on-multiclj

(throw-on-multi sql-source result-set value)

Handle :on-multi event in fetch fns by throwing exception.

Handle :on-multi event in fetch fns by throwing exception.
sourceraw docstring

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

× close