Skip to content

Conversation

@bplunkett-stripe
Copy link
Collaborator

@bplunkett-stripe bplunkett-stripe commented Jan 29, 2024

Description

This only adds support for fetching non-public schemas. This does actually allow generating migration plans for non-public schemas because we will need plumb several into the sql generation code to account for schemas.

I opted to do the filtering in-memory because it is way more flexible to do the filtering in-memory rather than in the queries. We can easily support things like regex and complex nested operations in the future (unions of intersections, etc). I don't expect the filters to significantly reduce the number of schema objects being fetched, so the performance impact of doing it in-memory is minimal.

Motivation

#94

Testing

Tested via unit tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is way more flexible to do this filtering in-memory rather than in the query. We can easily support things like regex and complex nested operations in the future (unions of intersections, etc).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the same filter Postgres uses in its pg_stat_user_tables view to filter down from pg_stat_all_tables.

@bplunkett-stripe bplunkett-stripe force-pushed the bplunkett/fetch-non-public-schemas branch from 970ecbc to 9863ee2 Compare January 29, 2024 05:41
Copy link

@ericw-stripe ericw-stripe left a comment

Choose a reason for hiding this comment

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

Nice!

@bplunkett-stripe bplunkett-stripe merged commit 4be624d into main Jan 29, 2024
@bplunkett-stripe bplunkett-stripe deleted the bplunkett/fetch-non-public-schemas branch January 29, 2024 18:28
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.

3 participants