Re: [DB] returning typed data when fetching rows

From: Date: Fri, 06 Aug 2004 11:51:54 +0000
Subject: Re: [DB] returning typed data when fetching rows
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32475@lists.php.net to get a copy of this message
News.Php.Net wrote:
Although I plan to use them in the near future, there is at least one feature that I find missing from them: I would like to have strongly typed data when fetching rows. If a column is of type INTEGER, I expect to get PHP integers, arrays, booleans instead of strings ('4', '{"foo","bar",{"this is foobar"}}', 't'...).
MDB and MDB2 already do this.
First, I don't seem to find in either MDB or MDB2 an automated way of fetching typed data (you have to manually pass an array of types). Second, I don't see any code that handles PgSQL arrays, i.e. that transforms a PgSQL array ('{123, 456, 789}' into a PHP array (array (123, 456, 789)), and a PHP array into a PgSQL string representation of an array (the reverse operation). By the way, MDB_Manager_pgsql::getTableFieldDefinition() returns an error on fields that are PgSQL arrays (of type INTEGER[] for instance).
*sigh*
I hope I'm missing something here.
regards,
Likewise.
Lukas
Guillaume

« previous php.pear.dev (#32475) next »