No matching definitions.

postgres/row

src/postgres/row.tur
defn

rows-count

(rows-count [rows :int] :int)

return the number of rows in a result set.

rowsrows handle (ok-val from db-query or stmt-exec-prepared)

Row count as :int.

(rows-count rows)  ; => 3

Since: PG0

defn

rows-free

(rows-free [rows :int] :void)

release a result set returned by db-query or stmt-exec-prepared.

rowsrows handle to free

void

(rows-free rows)

Since: PG0

defn

row-get

(row-get [rows :int i :int colname :cstr] :cstr)

retrieve a column value by name from a specific row.

rowsrows handle
i0-based row index
colnamecolumn name as :cstr

Column text value as :cstr; "" if column not found or value is NULL.

(row-get rows 0 "name")  ; => "Alice"

Since: PG0

defn

row-get-int

(row-get-int [rows :int i :int colname :cstr] :int)

retrieve a column value by name as an integer.

rowsrows handle
i0-based row index
colnamecolumn name as :cstr

Column value converted from text to :int via atoi; 0 if not found or NULL.

(row-get-int rows 0 "id")  ; => 42

Since: PG0

defn

col-count

(col-count [rows :int] :int)

return the number of columns in a result set.

rowsrows handle

Column count as :int.

(col-count rows)  ; => 2

Since: PG0

defn

col-name

(col-name [rows :int j :int] :cstr)

return the name of a column at 0-based index j.

rowsrows handle
j0-based column index

Column name as :cstr (valid until rows-free); "" if out of range.

(col-name rows 0)  ; => "id"

Since: PG0