Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 79264 invoked from network); 9 Dec 2004 13:23:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Dec 2004 13:23:32 -0000 Received: (qmail 28760 invoked by uid 500); 9 Dec 2004 13:22:54 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 28727 invoked by uid 500); 9 Dec 2004 13:22:54 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 28618 invoked by uid 99); 9 Dec 2004 13:22:52 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) X-pair-Authenticated: 24.44.79.162 Message-ID: <41B851C1.9000706@electricjellyfish.net> Date: Thu, 09 Dec 2004 08:23:13 -0500 From: Garrett Rooney User-Agent: Mozilla Thunderbird 1.0RC1 (X11/20041201) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nick Kew CC: dev@apr.apache.org Subject: Re: apr_dbd: a generic SQL wrapper References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Nick Kew wrote: > On Mon, 6 Dec 2004, Nick Kew wrote: > > >>Currently I have code for a proposed apr_dbd that compiles and loads >>cleanly, comprising apr_dbd.[c|h], a MySQL driver apr_dbd_mysql, > > > I've now added a test program, and the drivers for MySQL and PostgreSQL > work for me. Time to post here for preliminary review. > > I attach the current candidate APR software: > > apr_dbd.h - specifies the API > apr_dbd.c - implements (skeleton) framework > apr_dbd_mysql.c - driver for MySQL > apr_dbd_pgsql.c - driver for PostgreSQL > apr_dbd_test.c - test program > > There's a package containing this together with some related stuff > at http://www.apache.org/~niq/apache-dbd.tar.bz2 > > If it is accepted as a startingpoint for an apr-util module, I'll > donate it to ASF and license it all under ASF terms. > If not, all rights reserved. This looks very cool. I've got a few questions/comments though, just from a quick review. Why does apr_dbd_open take a temp pool? Can't it just create a scratch subpool and destroy it at the end of the function? I can't recall any other public APIs that take multiple pools. Why does apr_dbd_close specifically check if the pool it's given is NULL? Most other places in APR die in the face of bad input, why is this different? Why do some of the typedefs end in _t and some not? Why does the close function take a void arg? Can't we just pass it an apr_dbt_t *? > The Prepared Statement stuff is ugly: do any of the Perl folks know > how Perl DBI deals with different syntaxes and backends, and is there > anything we can usefully steal? That's a good question... I'll have to think about that. -garrett