chickadee » sql-de-lite » map-rows

map-rows procprocedure
map-rows* procprocedure

Return a procedure suitable for passing to query, taking one argument, a statement object.

The procedure will call fetch once for each row and call (proc row), collecting the results into a list, in order.

(query (map-rows car) s)
; => (1 2)

Another example; these two produce equivalent results:

(query (map-rows car) (sql db "select name, sql from sqlite_master;"))
(map car (query fetch-all (sql db "select name, sql from sqlite_master;")))

map-rows* behaves like map-rows, but your callback is invoked with one argument for each column value.