Simple sql dump utility.

dev-master 2017-04-30 00:00 UTC


This is a simple utility that make a dump of a selected database to a text file containts the sql code and the data to recreate the database.

The sql text file should include the table structure the complete data and the indexes.

It don't dump Views, Stored procedures and so... because it's very simple, but it do his job.

It require and use monolog to export messages, error, and so...


It's so simple. Create a instance of the class passing a \PDO instance and a monolog instance.

And execute his dumpSQL method $example->dumpSQL([$filename]). The filename it's optional (it default to 'Dump.sql')

The other methods can be used also to extract only tables, fields anda data and so,... if you want.

$dumpTest = new sqlDump\sqlDump($pdo, $logger);
echo $dumpTest->dumpSQL();