Skip site navigation (1) Skip section navigation (2)

Re: Php abstraction layers

From: Chris Travers <chris(at)travelamericas(dot)com>
To: Antimon <antimon(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Php abstraction layers
Date: 2005-08-31 04:00:36
Message-ID: 43152B64.2010102@travelamericas.com (view raw or flat)
Thread:
Lists: pgsql-general
Antimon wrote:

>Hi,
>I'm working on a new web project based on php and i decided to use
>PostgreSQL 8.x as
>dbms. For triggers, views, stored procedures etc. I was going to write
>a simple wrapper class and use pg_* functions. But some friends adviced
>me to use an abstraction layer. I checked PEAR:DB and AdoDB. They look
>pretty but i don't understand why sould i need one?
>
Do yourself a favor and write lightweight wrapper functions.  This means 
that if something needs to be changed (say, a PHP API name change 
happens) you don't have to rewrite a lot of your code.  Additionally, if 
you do have to port someday to Interbase or even (gasp) MySQL, it 
becomes possible thought not always straightforward.
  *Simple* and light database abstractions are very nice because they 
isolate your framework from the API syntax and after a few years, 
something could change and then you don't have to rewrite a whole lot.

Best Wishes,
Chris Travers
Metatron Technology Consulting

In response to

Responses

pgsql-general by date

Next:From: Alvaro HerreraDate: 2005-08-31 04:04:02
Subject: Re: Planner create a slow plan without an available index
Previous:From: Jim C. NasbyDate: 2005-08-31 03:48:19
Subject: Re: About "ERROR: must be *superuser* to COPY to or from a file"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group