Skip to content

Be able to specify PDO::ATTR_ options for connection #1844

@edsonhoraciojunior

Description

@edsonhoraciojunior

This is a:

  • enhancement

  • Phinx Version: 0.11.4 hash: 10e8c3f

  • Platform and Target: nginx, MySQL 5.7, PHP 7.2

What you did

I need to specify \PDO::ATTR_ options for MySQL connection, but Phinx only allow \PDO::MYSQL_ATTR_ options.

Example

\PDO::ATTR_PERSISTENT => true,
\PDO::ATTR_CASE => \PDO::CASE_LOWER,
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY> = false,

What happened

There's no way to do it currently.

What you expected to happen

I expect to be able to specify \PDO::ATTR_ options when connecting to the database. It would also be nice to have it in the docs for both \PDO::ATTR_ and \PDO::MYSQL_ATTR_ options.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions