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

Use an existing PDO connection?

Open donatj opened this issue 1 year ago • 1 comments

Our Di package provides us with our PDO connections, it'd be really handy if we could do something like

$dump = IMysqldump\Mysqldump::fromPdo($existingPdoObject);

I'd be willing to try my hand at implementing this - I'm just wondering if there'd be interest before I invest the time.

donatj avatar Feb 09 '24 20:02 donatj

I don't see the need to use an existing pdo connection (no benefits, all cons) but yes, I would merge such a PR, but try to force default settings if user don't provide them. Take into account that the pdo provided may have settings that aren't compatible with mysqldump-php, so please put a big warning in the documentation.

Our Di package provides us with our PDO connections, it'd be really handy

if we could do something like

$dump = IMysqldump\Mysqldump::fromPdo($existingPdoObject);

I'd be willing to try my hand at implementing this - I'm just wondering if there'd be interest before I invest the time

ifsnop avatar Feb 10 '24 13:02 ifsnop