Qovery / Replibyte

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

Feature: add options to dump specific tables #150

Closed fabriceclementz closed 2 years ago

fabriceclementz commented 2 years ago

As we discussed on Discord, it will be great to have some options to dump specific tables. By adding a new option only_tables RepliByte will only dump these tables.

This is an example of the final config file:

source:
  only_tables:
    - database: public
      table: us_states
    - database: public
      table: order_details

Here only the tables named us_states and order_details must be included in the dump.

An error must be triggered if a table is present in skip and only_tables when both options are used in conjunction.

evoxmusic commented 2 years ago

As discussed, it looks good to me. It's a valid use case when a user only needs to backup a couple of tables.

karpa4o4 commented 2 years ago

Hi @evoxmusic I would like to work on this issue. I'd appreciate it if you could give me some instructions.

evoxmusic commented 2 years ago

Hi @karpa4o4 I'm in transit but I'll give you some details on what is expected

karpa4o4 commented 2 years ago

@evoxmusic I have a question about the place where the table filtering will be. Do I understand correctly what needs to be done when calling pg_dump? I just noticed that skip filtering is done in read_and_transform.

karpa4o4 commented 2 years ago

@evoxmusic, can you help me with the question above?