RE: [PEAR-DEV][DB] Suggestion for field types
| From: | Lukas Smith | Date: | Thu, 08 Jan 2004 15:56:59 +0000 |
| Subject: | RE: [PEAR-DEV][DB] Suggestion for field types | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24893@lists.php.net to get a copy of this message | ||
> From: Paul M Jones [mailto:pmjones@ciaweb.net]
> Sent: Thursday, January 08, 2004 4:47 PM
> On Jan 8, 2004, at 4:58 AM, Peter wrote:
>
> > Is there a mechanism in pear DB to ask about the generic field type?
> > Eg. the following would be useful:
> >
> > ... $i = ... column number of result
> > if ($result->isNumber($i)) ... code to right justify result
> > if ($result->isChar($i)) ... code to quote/do case conversion etc.
> > ...
> >
> > This would avoid having to worry about strange types like bpchar,
> > SQLSMINT, int2. My feeling is the native types should in fact be
> > entirely invisible via PEAR - that's what the native API's are for.
>
> Hey, funny you should mention that -- something similar is in the
> validation methods for DB_Table proposal. ;-)
Alternatively you may want to look at MDB and MDB2.
Both feature full datatype abstraction (including LOB support).
Regards,
Lukas