Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add documentation about only_tables and skip options #271

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions website/docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,54 @@ Any datastore compatible with the S3 protocol is a valid datastore.

:::

## Select tables from the source

You have the possibility to select which tables you want in the dump.

There are two options to achieve this:
1. By specifying a list of tables you want (include strategy)
2. By skipping a list of tables you don't want (exclude strategy)

### Include strategy (`only_tables`)

Add a key named `only_tables` under the `source`:

```yaml
source:
connection_uri: postgres://root:password@localhost:5432/root
only_tables: # optional - dumps only specified tables.
- database: public
table: orders
- database: public
table: customers
```

### Exclude strategy (`skip_tables`)

Add a key named `skip` under the `source`:

```yaml
source:
connection_uri: postgres://root:password@localhost:5432/root
skip: # optional - exclude from the dump the specified tables.
- database: public
table: us_states
- database: public
table: order_details
```

This will exclude from the dump the tables `us_states` and `order_details`.

:::warning

This will exclude the table schema AND the table data.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #225

:::

:::warning

Currently only PostgreSQL and MySQL sources support this feature.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm wrong on this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do you know if this is working only when Replibyte is in charge of the dump?

Is the skip and only_tables working when I run something like:

cat your_dump.sql | replibyte -c conf.yaml dump create -i -s postgresql

?

:::

## Example

Here is a configuration file including some transformations and different options like the database subset.
Expand Down