ifsnop / mysqldump-php

PHP version of mysqldump cli that comes with MySQL
https://github.com/ifsnop/mysqldump-php
GNU General Public License v3.0
1.25k stars 300 forks source link

Table selection #226

Open MikeBrice opened 3 years ago

MikeBrice commented 3 years ago

I have recently found this project and am finding it a huge help. I have two collections of tables in the same schema each with a seperate prefix value in the table names. I would like to dump only one of the collections of tables, that is to say all tables with names starying with 'abc_'. I have seen that I can provuide an array of specific table names but for me it would be simper if I coule provide a table name prefix value. Is this possible ? If so how can I acgieve this ?

Many thanks for any guidance

smalos commented 3 years ago

Select all tables with the "abc_" prefix, run a query and pass its result to setTableWheres()

SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE() AND table_name like 'abc_%'

ifsnop commented 3 years ago

Thanks for using it. The exclude table list supports exactly what you want, using regular expressions For the include table, support for r hasn't been added yet. If you find this project useful and would like to contribute, please do so.

Meanwhile, the other answer will do the job for you, but you need to manage the connection by yourself.

Regards

I have recently found this project and am finding it a huge help.

I have two collections of tables in the same schema each with a seperate prefix value in the table names. I would like to dump only one of the collections of tables, that is to say all tables with names starying with 'abc_'. I have seen that I can provuide an array of specific table names but for me it would be simper if I coule provide a table name prefix value. Is this possible ? If so how can I acgieve this ?

Many thanks for any guidance