0

I instantiate my db adapter like this:

return new \Phalcon\Db\Adapter\Pdo\MySql(array(
    "host"     => $options["host"],
    "username" => $options["username"],
    "password" => $options["password"],
    "dbname"   => $options["dbname"],
));

I would like to be able to force all my queries to be forced to "buffered" as explained here (pdo part): http://us1.php.net/manual/en/mysqlinfo.concepts.buffering.php

How can I pass:

$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);

to phalcon's pdo adapter ?

Tomasz Rakowski
  • 1,052
  • 4
  • 13
  • 27
  • PDO have this attribute set to TRUE by default. You don't need to set it manually – Your Common Sense Apr 01 '14 at 16:05
  • That link seems to imply that queries are buffered by default, do you need to do this? – askrich Apr 01 '14 at 16:06
  • As far as I know, PDO by default does unbuffered queries. This doc is misleading. Another article: http://stackoverflow.com/questions/578665/php-pdo-buffered-query-problem seems to be dealing with it in depth – Tomasz Rakowski Apr 01 '14 at 16:10

1 Answers1

3

You can pass any PDO option as follows:

return new \Phalcon\Db\Adapter\Pdo\MySql(array(
    "host"     => $options["host"],
    "username" => $options["username"],
    "password" => $options["password"],
    "dbname"   => $options["dbname"],
    "options"  => array(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)
));
twistedxtra
  • 2,699
  • 1
  • 18
  • 13