1

I using symfony2 with doctrine for my project.

How I can turn off prepare statement for every sql query?

I need it because, I use pgbouncer for PostgreSQL connect and prepare statement doesn't support.

2 Answers2

0

You can use this:

doctrine:
    dbal:
        connections:
            default:
                driver:   "%database_driver%"
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                options:
                    20: true # PDO::ATTR_EMULATE_PREPARES

PDO::ATTR_EMULATE_PREPARES equals to 20, but the last time I checked, you weren't allowed to use it as a hash key, thus 20.

-2

I am still searching for solution. But you can use native pg_connect() function

ph4n70m
  • 300
  • 2
  • 6