-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add support for aggregates, composite types, partitions, and more #90
Open
joshainglis
wants to merge
30
commits into
djrobstep:master
Choose a base branch
from
joshainglis:upstream-pr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently only table privileges are handled
As per @jld3103
As per @jld3103
In the file 'triggers.sql', a subquery was added to exclude triggers related to partition child tables. The decision to exclude these triggers is based on the assumption that they inherit the triggers of their parent tables, so it is unnecessary to list them separately. This gives a clearer and more concise output from the triggers query, reducing redundancy and potential confusion.
The code is modified to exclude the partition child tables when checking for table privileges in the `privileges.sql` file. Earlier, the privileges check was including all the tables. With this change, the partitioned child tables, which generally do not require independent privileges, are excluded from the privileges check. This enhances the accuracy of the privilege validation process.
This commit adds new functionality to the codebase to allow inspection of aggregate database functions. The `InspectedAggFunction` class was added to `schemainspect/pg/obj.py`, with properties needed to create, describe, and delete aggregate functions. Moreover, `load_aggregate_functions` method was added to the `PostgreSQL` class in the same file to facilitate loading of these functions. Associated queries for getting this information are stored in `agg_functions.sql`. This was done to enhance the library's capabilities and cover more aspects of database inspecting.
Modified the function identifier in schemainspect to include return type. Previously, function identification was only based on the function's full name and identity arguments. This change accommodates functions with identical arguments but different return types. (cherry picked from commit 467a12b)
(cherry picked from commit 621e7b4)
Added the function result to the quoted and unquoted identifiers, as well as to the dependencies. This additional parameter was included in multiple functions and SQL queries, and it allows to better identify and manage dependencies in the 'schemainspect' Python module. (cherry picked from commit 91fe044)
This can happen if a column is of a custom type and the type is deleted with a cascade (cherry picked from commit f2f5dff)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds several enhancements and new features to
schemainspect
.Support for inspecting aggregate functions. A new
InspectedAggFunction
class was added along with the query to retrieve aggregate function details. Aggregate functions are now included when comparing schemas.Support for composite types. The dependency queries were updated to properly handle composite types. Tables based on composite types are now inspected as regular tables.
Partition tables are now handled - child partition tables are excluded from privilege and trigger inspection to avoid duplicate output.
Schema-level and function-level privileges are now included in addition to table-level privileges. The privilege query was significantly expanded to capture all privilege types.
Comments on all major object types (tables, views, columns, types, functions, etc) are now inspected using a new
InspectedComment
class and query.Empty string schemas are now handled properly in the
quoted_full_name
property.Various bug fixes, including:
get_dependency_by_signature
could returnNone
eq
comparisonEnabled PEP 517 building in pyproject.toml
This PR builds on top of @biodevc's fork at https://github.com/biodevc/schemainspect