chickadee » awful » $db-row-obj

($db-row-obj q) procedure

Execute the given query q on the database and return an one-argument procedure which takes as argument the name of the database field to get the value.

Example:

(let ((& ($db-row-obj "select full_name, phone from users where user_id=1")))
  (<p> "Full name: " (& 'full_name))
  (<p> "Phone: " (& 'phone)))

Warning: currently $db-row-obj is only implemented for Postgresql databases.