[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-internals
Subject:    Re: [PHP-DEV] Re: [PDO] Re: [PHP-DEV] Re: [PDO] Re: [PHP-DEV] [PATCH]
From:       Stanley Sufficool <ssufficool () gmail ! com>
Date:       2010-06-15 2:03:52
Message-ID: AANLkTinbRFFfuH728-CLTXZSt5WG0g_oOzZL9ZbyJftL () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jun 14, 2010 at 2:21 AM, Ferenc Kovacs <info@tyrael.hu> wrote:
>> > I don't know sqlite or IBM, but the MySQL SELECT INTO OUTFILE is a plain
>> > SQL
>> > statement, you don't need any special pdo function to use it, on the
>> > other
>> > hand, you can't use the postgresql's COPY TO/FROM with PDO without the
>> > patch
>> > above.
>> > Did I misunderstood something?
>>
>> well, even if it's possible to do as "sql" in mysql, it is still possible
>> to implement as the method.
>>
>> p.s. actually, as we're talking about "trunk" it is still possible to
>> implement these methods in generic fashion.
>> I can provide implementation for pdo_mysql (unless anyone else will be
>> faster).
>> does anyone know enough about ibm's api to provide implementation for it?
>>
>
> I don't think that is a good idea.
> For example in mysql, you can SELECT INTO OUTFILE any sql result, for
> postgresql, you can only import/export a table:
> http://www.postgresql.org/docs/8.1/static/sql-copy.html
> So the two feature is different, and I can't see a point, that why should we
> force different features into a common functionality.

In the case of query export, the copyTo belongs at the statement level.
$stmt = $pdo->query("SELECT field1, anotherField from table where
field1 = 'somevalue');
$stmt->copyTo(args...)

Obviously, copyFrom at the statement level would not make sense.

In the case of a table export, at the driver level as it it for PostgreSQL.

Again, leaving it to the driver maintainer to either not-implement,
implement a compatibility layer using SQL or implement natively at the
library level.

> For postgres I think we had to provide this functionality somehow, because
> it was impossible to do this with through PDO.
> But we think it over, before we over-generalize the function.
> Tyrael
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic