Types#
- class pg_grant.types.PgObjectType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
Enum
PostgreSQL object type.
- class pg_grant.types.Privileges(grantee: str, grantor: str, privs: List[str] = _Nothing.NOTHING, privswgo: List[str] = _Nothing.NOTHING)[source]#
Bases:
object
Stores information from a parsed privilege string.
See also
- as_grant_statements(type: Literal[PgObjectType.TABLE, PgObjectType.SEQUENCE, PgObjectType.LANGUAGE, PgObjectType.SCHEMA, PgObjectType.DATABASE, PgObjectType.TABLESPACE, PgObjectType.TYPE, PgObjectType.FOREIGN_DATA_WRAPPER, PgObjectType.FOREIGN_SERVER, PgObjectType.FOREIGN_TABLE, PgObjectType.LARGE_OBJECT], target: str, *, schema: str | None = None, arg_types: List[str] | Tuple[str, ...] | None = None, quote_subname: bool = True) List[Executable] [source]#
- as_grant_statements(type: Literal[PgObjectType.TABLE], target: TableClause | Type[Any] | Mapper[Any], *, schema: None = None, arg_types: None = None, quote_subname: bool = True) List[Executable]
- as_grant_statements(type: Literal[PgObjectType.SEQUENCE], target: Sequence, *, schema: None = None, arg_types: None = None, quote_subname: bool = True) List[Executable]
- as_grant_statements(type: Literal[PgObjectType.FUNCTION], target: str, *, schema: str | None = None, arg_types: List[str] | Tuple[str, ...], quote_subname: bool = True) List[Executable]
Return array of
grant()
statements that can be executed to grant these privileges. Refer to the function documentation for the meaning of target and additional keyword arguments.Note
This requires installing with the
sqlalchemy
extra.
- as_revoke_statements(type: Literal[PgObjectType.TABLE, PgObjectType.SEQUENCE, PgObjectType.LANGUAGE, PgObjectType.SCHEMA, PgObjectType.DATABASE, PgObjectType.TABLESPACE, PgObjectType.TYPE, PgObjectType.FOREIGN_DATA_WRAPPER, PgObjectType.FOREIGN_SERVER, PgObjectType.FOREIGN_TABLE, PgObjectType.LARGE_OBJECT], target: str, *, schema: str | None = None, arg_types: List[str] | Tuple[str, ...] | None = None, quote_subname: bool = True) List[Executable] [source]#
- as_revoke_statements(type: Literal[PgObjectType.TABLE], target: TableClause | Type[Any] | Mapper[Any], *, schema: None = None, arg_types: None = None, quote_subname: bool = True) List[Executable]
- as_revoke_statements(type: Literal[PgObjectType.SEQUENCE], target: Sequence, *, schema: None = None, arg_types: None = None, quote_subname: bool = True) List[Executable]
- as_revoke_statements(type: Literal[PgObjectType.FUNCTION], target: str, *, schema: str | None = None, arg_types: List[str] | Tuple[str, ...], quote_subname: bool = True) List[Executable]
Return array of
revoke()
statements that can be executed to revoke these privileges. Refer to the function documentation for the meaning of target and additional keyword arguments.Note
The statement for the privswgo privileges will revoke them fully, not only their grant options.
Note
This requires installing with the
sqlalchemy
extra.
- class pg_grant.types.RelationInfo(*, oid: int, name: str, owner: str, acl)[source]#
Bases:
object
Holds object information and privileges as queried using the
query
submodule.
- class pg_grant.types.SchemaRelationInfo(*, oid: int, name: str, owner: str, acl, schema: str)[source]#
Bases:
RelationInfo
Holds object information and privileges as queried using the
query
submodule.
- class pg_grant.types.FunctionInfo(*, oid: int, name: str, owner: str, acl, schema: str, arg_types)[source]#
Bases:
SchemaRelationInfo
Holds object information and privileges as queried using the
query
submodule.