mysqldump-php icon indicating copy to clipboard operation
mysqldump-php copied to clipboard

Factories for providing our PDO connection.

Open pc-magas opened this issue 3 years ago • 3 comments

I would love if I could use an existing PDO commection and Mysqldump could just use the existing connection to handle the dumps.

I mean If I could have a usage like:

/**
*
*/
$pdo = new PDO();

$dump = Mysqldump::fromPDO($pdo);
$dump->start('storage/work/dump.sql');

I would appriocate it. Thas because I can use it with existing frameworks better. Usually frameworks ship with their own PDO.

pc-magas avatar Jul 27 '22 12:07 pc-magas

I would love if I could use an existing PDO commection and Mysqldump could just use the existing connection to handle the dumps.

I agree with you, I also think using an existing PDO could be very useful. But mysqldump needs to do some initialisations to the PDO connection that could fail if other framework handles/does the connection code.

I would agree to merge if that patch has the corresponding big big warning in the documentation.

Kind regards

ifsnop avatar Jul 27 '22 15:07 ifsnop

We can clone the existing PDO and place out own serttings.

pc-magas avatar Jul 28 '22 09:07 pc-magas

We can clone the existing PDO and place out own serttings.

If you consider providing a pull request, please reopen the issue.

-- -- Use of a keyboard or mouse may be linked to serious injuries or disorders. diego dot torres at gmail dot com - Madrid / Spain

ifsnop avatar Jul 28 '22 10:07 ifsnop