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

Support including or excluding list of schemas, not just single schema #68

Open
daa opened this issue Jul 23, 2021 · 2 comments · May be fixed by #71
Open

Support including or excluding list of schemas, not just single schema #68

daa opened this issue Jul 23, 2021 · 2 comments · May be fixed by #71

Comments

@daa
Copy link

daa commented Jul 23, 2021

Work done in #58 adds an ability to include or exclude single schema, but recently I've met the need to limit considered schemas to a list of them or symmetrically to exclude a list of schemas from consideration, hence this feature request. Also I'd like to submit a pull request with implementation.

As for implementation I see 2 possible ways:

  • make get_inspector() and schemainspect.pg.obj.PostgreSQL.filter_schema() to accept list of strings in schema and exclude_schema parameter. Here again we have 2 possibilities: accept list in addition to just string to keep old behaviour or accept only list and break compatibility
  • treat schema and include_schema parameters as regular expression patterns thus keeping function signature but slighly changing old behaviour: passing plain string would mean matching schema by given prefix

What do you think? Personally I lean towards the first alternative, i.e. accept a list of strings in addition to just string in corresponding function and method parameters.

@daa daa changed the title Support including or excluding list of schema, not just single schema Support including or excluding list of schemas, not just single schema Jul 23, 2021
@daa
Copy link
Author

daa commented Jul 25, 2021

Recently I thought that we have a third alternative: make database inspector and consequently get_inspector() accept argument with predicate function to match schema and then apply this function to filter affected schemas. We may reuse schema argument or add a new argument, for example accept_schema in addition to schema and exclude_schema and may be gradually deprecate the latter because proposed approach covers all their possible usage variants. I'd like to hear your opinion on this.

@rienafairefr rienafairefr linked a pull request Aug 20, 2021 that will close this issue
@actuchicks
Copy link

Thanks for raising this @daa - we also have a need to exclude multiple schemas from migra processes and would be really keen to see this resolved 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants