awful + postgresql example added by mario-goulart on Mon Nov 19 12:09:17 2012

(use awful awful-postgresql)

(enable-db) ;; to enable db access. PostgreSQL in this 
            ;; case, since we are using awful-postgresql

(enable-sxml #t) ;; for SXML mode.  Recommended.

(db-credentials ;; data required to connect to the database
 '((dbname . "the-db-name")
   (user . "user")
   (password . "password")
   (host . "localhost")))

(define-page (main-page-path)
  ;; (main-page-path)'s default is "/", so you can access http://localhost:8080/
  (lambda ()
    `(pre
      ,(->string
        ($db "select column1, column2 from a-table where column2=$1"
             values: (list "something"))))))