-
Notifications
You must be signed in to change notification settings - Fork 128
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`) | ||
|
||
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. | ||
::: | ||
|
||
:::warning | ||
|
||
Currently only PostgreSQL and MySQL sources support this feature. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm wrong on this There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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. | ||
|
@@ -118,6 +166,12 @@ source: | |
table: orders | ||
- database: public | ||
table: customers | ||
# skip: # optional - exclude from the dump the specified tables. | ||
# - database: public | ||
# table: us_states | ||
# - database: public | ||
# table: order_details | ||
|
||
datastore: | ||
aws: | ||
bucket: $BUCKET_NAME | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to #225