xpgdiff.py
def print_grant_migration_ddl(source_object, source_grant, target_grant):
    """
    Prints the migration DDL for a single grant on an object.

    :param source_object: The object in the source schema.
    :param source_grant: The grant on the object in the source schema.
    :param target_grant: The grant on the object in the target schema.
    """
    revokes = set(source_grant.privilegestr) - set(target_grant.privilegestr)
    grants = set(target_grant.privilegestr) - set(source_grant.privilegestr)

    if revokes:
        print(Grant(source_object, source_grant.role, "".join(revokes)).revokestr())

    if grants:
        print(Grant(source_object, source_grant.role, "".join(grants)).grantstr())

    Prints the migration DDL for a single grant on an object.

    :param source_object: The object in the source schema.
    :param source_grant: The grant on the object in the source schema.
    :param target_grant: The grant on the object in the target schema.
    
Prints the migration DDL for a single grant on an object.
Prints the migration DDL for a single grant on an object .
def print_grant_migration_ddl(source_object, source_grant, target_grant):
    revokes = set(source_grant.privilegestr) - set(target_grant.privilegestr)
    grants = set(target_grant.privilegestr) - set(source_grant.privilegestr)
    if revokes:
        print(Grant(source_object, source_grant.role, "".join(revokes)).revokestr())
    if grants:
        print(Grant(source_object, source_grant.role, "".join(grants)).grantstr())
def print_grant_migration_ddl ( source_object , source_grant , target_grant ) : revokes = set ( source_grant . privilegestr ) - set ( target_grant . privilegestr ) grants = set ( target_grant . privilegestr ) - set ( source_grant . privilegestr ) if revokes : print ( Grant ( source_object , source_grant . role , "" . join ( revokes ) ) . revokestr ( ) ) if grants : print ( Grant ( source_object , source_grant . role , "" . join ( grants ) ) . grantstr ( ) )
Prints the migration DDL for a single grant on an object.
Prints the migration DDL for a single grant on an object .
"""
    Prints the migration DDL for a single grant on an object.

    :param source_object: The object in the source schema.
    :param source_grant: The grant on the object in the source schema.
    :param target_grant: The grant on the object in the target schema.
    """
source_object
The object in the source schema.
The object in the source schema .
source_grant
The grant on the object in the source schema.
The grant on the object in the source schema .
target_grant
The grant on the object in the target schema.
The grant on the object in the target schema .