|
From: | Jean-Philippe Theberge |
Subject: | Re: [Chicken-users] Help with the mysql egg |
Date: | Wed, 23 Jan 2008 08:30:45 -0500 |
User-agent: | Mozilla-Thunderbird 2.0.0.9 (X11/20080109) |
Toby Butzon wrote:
On Jan 22, 2008 2:41 PM, Kon Lovett <address@hidden> wrote:You might want to contact address@hidden, the author. I don't know if he is active with egg maintenance though.I'm an active lurker... :) Any of those options is fine by me -- if a patch comes my way, I'll make sure it gets included.
Thanks! The patch is attached. It add Ken's mysql-fetch-field-list and mysql-fetch-alist. -- BuddyPilots <http://www.buddypilots.com> *Jean-Philippe Théberge* *Programmeur Architecte* Tel: (514) 353-2307
139a140,142 > mysql-fetch-field-list > mysql-fetch-alist > 735a738,756 > > (define mysql-fetch-field-list > (let ([get-field-name > (foreign-lambda* c-string ([c-pointer fields] [unsigned-integer > idx]) > "return (((MYSQL_FIELD *)fields)[idx].name);")]) > (lambda (conn) > (and-let* ([res (mysql-connection-result conn)]) > (let ([fields (foreign-mysql-fetch-fields res)]) > (let loop ([count (foreign-mysql-num-fields res)] [names '()]) > (if (zero? count) > names > (let ([nxtcnt (sub1 count)]) > (loop nxtcnt (cons (get-field-name fields nxtcnt) names)) ) > ) ) ) ) ) ) ) > > (define (mysql-fetch-alist conn) > (define row (mysql-fetch-row conn)) > (define fields-list (mysql-fetch-field-list conn)) > (map (lambda (f) (cons f (row f))) fields-list)) >
[Prev in Thread] | Current Thread | [Next in Thread] |