Hello,
Am Dienstag, 9. Oktober 2007 schrieb David Goodwin:
> > > Well, we could always bundle mdb2 / pear db with postfixadmin -
> > > this would remove any requirement for admins to set it up etc.
> >
> > I'd like to split this to two questions:
> > a) do we want to use a database abstraction layer?
> > b) which one
> >
> > a) Well, if there's a good and lightweight one available...
> >
> > Let's sum up our database usage:
> > - INSERT and UPDATE queries
> > - DELETE queries
> > - SELECT queries with WHERE and LIMIT
> > - begin/end transaction
> > (did I miss something?)
> >
> > So for me the question is if we need a full-featured abstraction
> > layer or only some simple functions that generate the query.
> >
> > If the abstraction layer adds some hundred kB to the tarball, then
> > we need really good arguments for it IMHO ;-)
>
> I'm not particuarly bothered by the 'size of the tarball' issue.
> Hundreds of kb are pretty in significant.
It's not about filesize, but about complexity. I'd like to understand
the code I'm using ;-)
> My requirements are :
>
> 1) Support for prepared statements
Basically yes, but it depends on the amount of code we need.
If we need some hundred kB just to be able to replace (pseudocode)
"... WHERE field='" . db_escape($value) . "'"
with
"... WHERE field=?"
execute ($query, $value)
then I would call it too much overhead ;-)
> 2) Support for a url-like database connection
Why/where do you see an anvantage in this point?
> (postfixadmin doesn't (yet) use sequences, so I think these are a non
> issue - but normally something an abstraction layer handles)
What do you mean with "sequences"?
> > b) Good question...
> >
> > Candidates are: (feel free to add missing ones)
> > - mdb2 (requires PEAR, together 420k as .tar.gz)
>
> Most people will already have PEAR.
> Did you include a specific driver in this figure?
No, I just checked the download size of PEAR + mdb2.
> > - pear db (http://pear.php.net/package/DB says it is obsolete and
> > mdb2 should be used)
> > - adodb (470 kB .tar.gz) (proposed by Viktor Gotwig)
> > - adodb lite (370 kB .tar.gz)
>
> Not used adodb.
Search for adodb vs. pear db/mdb2 comparisons, and you'll find several
people saying adodb and adodb lite are better ;-)
> > - the S9Y (www.s9y.org) database routines, which are simple
> > (only 8 kB .tar.gz) but effective.
> > If you want to have a look at it:
> >
> > http://php-blog.cvs.sourceforge.net/php-blog/serendipity/include/db/
[from the second mail]
> I don't think much of the one above; although it's minimal, it doesn't
> allow for prepared statements. Do you use S9Y?
Yes, I use S9Y for my blog (http://blog.cboltz.de).
S9Y supports INSERT and UPDATE with field=>value arrays, which is very
useful.
You are right that it doesn't allow prepared statements (however it
contains a function to quote a string correctly, and includes a
function for SELCT ... LIMIT), but OTOH it doesn't add much overhead.
Needless to say that that this is something for post-2.2 ;-)
Regards,
Christian Boltz
--
>>Habt Ihr noch alle Tassen im Schrank ?
>Die Referenztassen?
Nun, das Emacs - Referenzfass war jedenfalls nicht gemeint ...
[Christoph Moench-Tegeder und Hans Bonfigt in doc]
|