chickadee » dbi » get-rows

get-rows db query #!rest paramsprocedure

Execute the query on the database connection db and return the entire set, represented as a list of tuple vectors. The params should be rest arguments which replace the corresponding "?" placeholders in query.

Example:

(define mydb (open 'sqlite3 '((dbname . "/tmp/db"))))
(let ((tuples (get-rows
                mydb
                "SELECT name, year FROM films WHERE name = ? OR name = ?"
                "The Godfather" "Alien")))
  (pp tuples))
;; This will print something like:
;; (#("The Godfather" 1972)
;;   ("Alien" 1979))