Qovery / Replibyte

Seed your development database with real data ⚡️
https://www.replibyte.com
GNU General Public License v3.0
4.16k stars 128 forks source link

Feature: implement database subseting for MySQL #69

Open evoxmusic opened 2 years ago

evoxmusic commented 2 years ago

Implement database subsetting for MySQL as we did for PostgreSQL.

fabriceclementz commented 2 years ago

Hi @benny-n

I looked at the dump_header and dump_footer functions and they can't work with MySQL as the dump format is not the same as for PostgreSQL.

In Postgres, we have all the CREATE TABLE statement first, then INSERT INTO and ALTER TABLE.

For MySQL, we have:

Maybe one possible solution that might work could be to extract only the database structure first via mysqldump --no-data ... and then make the full dump and add the INSERT INTO statement at the end of the previously created dump?

There may be a better solution but I have no other idea at the moment.