[gambit-list] Poor man's MySQL wrapper for Gambit
Arto Bendiken
arto.bendiken at gmail.com
Sun Jun 11 20:48:45 EDT 2006
Howdy,
I recently needed to retrieve some data from MySQL with Gambit. I
wasn't able to find an MySQL FFI for Gambit, so I whipped up a simple
API wrapper around the mysql command line tool:
http://bendiken.net/files/gambit/gambit-mysql-wrapper.tar.bz2
While certainly not a proper binding, it serves my purpose admirably
and may perhaps be useful to others as well.
Usage is simple enough:
(define *user* "root")
(define *passwd* "root")
(let* ((conn (mysql-connect user: *user* password: *passwd*
db: "mysql"))
(query "SELECT host, user, password FROM user")
(result (mysql-query conn query)))
(while (mysql-fetch-row result)
(lambda (row)
(pretty-print row)))
(mysql-close conn))
More information is available from my blog post at:
http://bendiken.net/2006/06/11/poor-mans-mysql-api-for-gambit
Best regards from sunny Spain,
Arto
--
Arto Bendiken | arto.bendiken at gmail.com | http://bendiken.net/
More information about the Gambit-list
mailing list