Expand description
This module contains datastructures and logic for comparing database privileges, generating, validating and reducing diffs between two sets of database privileges.
Structs§
- Database
Privilege RowDiff - This struct encapsulates the before and after states of the access privileges for a single user on a single database.
Enums§
- Database
Privilege Change - This enum represents a change for a single privilege.
- Database
Privileges Diff - This enum encapsulates whether a
DatabasePrivilegeRowwas introduced, modified or deleted.
Functions§
- create_
or_ modify_ privilege_ rows - Converts a set of
DatabasePrivilegeRowDiffinto a set ofDatabasePrivilegesDiff, representing either creating new privilege rows, or modifying the existing ones. - diff_
privileges - This function calculates the differences between two sets of database privileges.
It returns a set of
DatabasePrivilegesDiffthat can be used to display or apply a set of privilege modifications to the database. - display_
privilege_ diffs - Renders a set of
DatabasePrivilegesDiffinto a human-readable formatted table. - reduce_
privilege_ diffs - Reduces a set of
DatabasePrivilegesDiffby removing any modifications that would be no-ops. For example, if a privilege is changed from Yes to No, but it was already No, that change is removed from the diff.