Skip to content

Skip tables#70

Merged
alexbruy merged 6 commits intomasterfrom
skip-tables
Jul 15, 2022
Merged

Skip tables#70
alexbruy merged 6 commits intomasterfrom
skip-tables

Conversation

@alexbruy
Copy link
Contributor

@alexbruy alexbruy commented Jul 8, 2022

Add option to ignore tables when performin sync. Requires geodiff with MerginMaps/geodiff#182 and Python client with MerginMaps/python-api-client#147.

Temporarily contains commits from #69.

Fixes #62.

@alexbruy alexbruy marked this pull request as ready for review July 8, 2022 11:56
dbsync.py Outdated
_run_geodiff([config.geodiff_exe, "diff", "--driver", driver, conn_info, base, modified, changeset])
def _geodiff_create_changeset(driver, conn_info, base, modified, changeset, ignored_tables):
if ignored_tables:
_run_geodiff([config.geodiff_exe, "diff", "--driver", driver, conn_info, "--skip-tables", ignored_tables, base, modified, changeset])
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe pass this as arg to _run_geodiff or even would it be possible to read it from config and decide inside of _run_geodiff?


mp = MerginProject(config.project_working_dir)
mp = MerginProject(work_dir)
mp.set_tables_to_skip(ignored_tables)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if there is a use case we need to remove/reset this settings or it is more like global settings for project in which case it might be better to pass it to constructor instead of having special method for that ...

base: mergin_base
mergin_project: john/myproject
sync_file: sync.gpkg
skip_tables:
Copy link
Contributor

Choose a reason for hiding this comment

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

just small note: does it work with some fancy tables names like 123MyAwesomeTable?

@alexbruy alexbruy merged commit 29a2c4c into master Jul 15, 2022
@alexbruy alexbruy deleted the skip-tables branch July 15, 2022 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optionally ignore some tables

2 participants