Module diff

Module diff 

Source
Expand description

This module contains datastructures and logic for comparing database privileges, generating, validating and reducing diffs between two sets of database privileges.

Structs§

DatabasePrivilegeRowDiff
This struct encapsulates the before and after states of the access privileges for a single user on a single database.

Enums§

DatabasePrivilegeChange
This enum represents a change for a single privilege.
DatabasePrivilegesDiff
This enum encapsulates whether a DatabasePrivilegeRow was introduced, modified or deleted.

Functions§

create_or_modify_privilege_rows
Converts a set of DatabasePrivilegeRowDiff into a set of DatabasePrivilegesDiff, 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 DatabasePrivilegesDiff that can be used to display or apply a set of privilege modifications to the database.
display_privilege_diffs
Renders a set of DatabasePrivilegesDiff into a human-readable formatted table.
reduce_privilege_diffs
Reduces a set of DatabasePrivilegesDiff by 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.

Type Aliases§

DatabasePrivilegeState