Re: Re: Announce: PDO beta releases
| From: | Reini Urban | Date: | Wed, 09 Feb 2005 20:57:36 +0000 |
| Subject: | Re: Re: Announce: PDO beta releases | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-1936@lists.php.net to get a copy of this message | ||
Reini Urban schrieb:
> Lester Caine schrieb:
>> As a longtime user of ADOdb, converting to something new may not be
>> practical, but at least Firebird is on the list which makes a nice
>> change.
>>
>> I'm not seeing an easy route to getting hold of a copy to play with
>> (windows :( ) and I'm not seeing much in the function list yet. Can
>> anybody give any feedback on what is missing at the moment mapped
>> against ADOdb functionality?
>
> Since my phpwiki keeps adodb and pear::db interfaces (and has a nice db
> abstraction), I will try out supporting PDO also and report / forward
> any issues here.
> We test windows + linux, php-4.{1-3}.x and php-5.0.x
> Mysql, sqlite regularly tested, oracle and pgsql about monthly.
>
> We'd need only the simple functionality already existing in PDO, nothing
> as fancy as adodb or pear::db also support.
Ok, porting was fast and easy. Very similar to perl DBI finally.
Following issues so far:
The dsn parser might get fooled by embedded usernames and
passwords and options, and other features supported by pear DB::parseDSN().
Apparently only the simple
"mysql:option1=value1;option2=value2" syntax is supported, but not the
usual
dbtype(dbsyntax)://username:password@protocol+hostspec/database?option=value&option2=value2
So we have to parse our old DSN syntax (via Pear DB::parseDSN() and put
it together in the simplier currently supported format.
Named pipes on NT are also problematic:
DSN: "mysql://wikiuser:@localhost/phpwiki"
DB Connection failed: SQLSTATE[HY000] [2017] Can't open named pipe to
host: . pipe: MySQL (2)
I'm using a mysqld-4.1.8 on NT with named pipe support. Winnt should
really default to host=127.0.0.1 and not "localhost".
README contains a wrong function name. See attached patch.
I don't know if the ->quote is needed. I could go away without it, but
I'm sure I missed a few unprepared statements somewhere which need a
pre-quoted query. (but this is a non-issue).
PDO_PARAM_LOB docs should be clarified. What type should I use for
BLOBS, esp. on pgsql, oci and mysql? Oracle has a special
PDO_ATTR_ORACLE_NULLS explicitly, but the others?
Haven't tested utf-8 issues yet. Japanese blobs might bite the 8bit
string functions.
PDO_MYSQL has some convenient old-style meta functions, haven't checked
if I really need them or better use SELECT queries.
Transaction transparency:
The adodb dbdriver handler knows from the dbtype name in the DSN that it
doesn't support transaction, and consequently ignores the calls.
PDO_MYSQL fails with: Uncaught exception 'PDOException' with message
'This driver doesn't support transactions'.
This is easy to check and workaround in the db class init, but there
should be a sample how to do that, because it will be a quite common case.
Besides that that it looks and works fine so far, but I haven't fully
tested it yet.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/