feat: filtering by schema(s) for tables, columns, types, policies and functions #375
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This PR introduces a new feature that allows filtering by schema(s) for the following:
What is the current behavior?
Currently, it's not possible to filter by schema(s).
What is the new behavior?
This PR allows filtering the given endpoints with a list of schemas using either
included_schemas
orexcluded_schemas
as a query parameter.Example Usage:
Additional context
Currently, it's only possible to pass schema(s) as a comma separated values (i.e.,
"...?included_schemas=public,core"
).When I tried defining
included_schemas
orexcluded_schemas
asstring[]
such as:Single value and comma separated values were still parsed as a string. This type argument would parse an array only if the parameter was passed multiple times (e.g.
"...?included_schemas=public&included_schemas=core"
). Based on a quick research, it seems arrays can be parsed correctly when using JSON Schema instead of generics but I didn't want to complicate this PR. So the API with this change will be limited to comma separated values forincluded_schemas
andexcluded_schemas
parameters.