NYCPHP Meetup

NYPHP.org

[nycphp-talk] Creating database tables when deploying products

Paul Houle paul at devonianfarm.com
Sun Apr 1 22:10:18 EDT 2007


Ben Sgro (ProjectSkyline) wrote:
> I suppose I can use PEAR:DB:SQLwhatever, but I'm intimate
> what my SQL code and don't want to give it up.
    I've mostly worked with ADODB.  When I last looked,  ADODB was far 
ahead of PEAR:DB, but it looks like PEAR:DB has come a long way.

    I have a few serious complaints with ADODB,  but it sure beats 
having to switch between a few database APIs to do my work.  Things I'd 
like to see in a database API are:

(i) no use of globals to switch between numeric and associative result sets
(ii) lazy initialization of database connections ('create' the 
connection early in your app,  but don't suffer the overhead of using it 
until you need it)
(iii) a subdivision of database exceptions,  so I can write something like

try {
    $db->Execute("INSERT ...");
} catch (DuplicateKeyException $e) {
...
};

The 'spring' framework in Java does something like this.




More information about the talk mailing list