Re: [PDO] Re: [PHP-DEV] [PATCH] New PDO methods for PostgreSQL driver

[email protected] (Lester Caine) Thu, 03 Jun 2010 21:53:14 +0100
Newsgroups php.pdo
Message-ID <[email protected]>
Sufficool, Stanley wrote:
> Am I missing something or can't you just add another set of function pointers to the PDO driver and statements like:
>
> driver_methods = {
> ...
>          pg_copy_from, /* OR NULL IF NOT SUPPORTED */
>          pg_copy_to
> };
>
> statement_methods = {
> ...
>          pg_copy_to
> };
>
> Then if the driver does not implement it, throw an exception. Then, in the future, these could be abstracted on a higher level for drivers that don't support it by using lower level INSERT / SELECTS. The difference in the abstraction being that the files would be on the client side, not the server.
>
> The initial values would of course be NULL except fo the PostgreSQL PDO drivers.
>
> Then call the functions as $pdo_obj->copyFrom(...) and $pdo_obj->copyTo(...) or $pdo_stmt->copyTo(...)

Given that I can see a simple way to emulate THAT side of things on Firebird, 
then certainly I would prefer to see that approach to ANY of these extensions. 
The problem remains of how we handle some of the incompatible data typing if you 
want to move results from one pdo connection to another.

What *IS* preventing the use of the generic drivers internally and simply 
mapping the data to a standard result set format?

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php