-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f293a31
commit f137bf3
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Privileges manipulation with SQLalchemy | ||
|
||
Add `grant/revoke privileges` construct | ||
|
||
## Usage | ||
|
||
Examples: | ||
```python | ||
>>> from sqlalchemy import * | ||
>>> from sqlalchemy_privileges import * | ||
|
||
>>> str(GrantPrivileges('insert', Table('a', MetaData(schema='schema')), 'my.name')) | ||
'GRANT INSERT ON schema.a TO "my.name"\n' | ||
|
||
>>> str(RevokePrivileges(['insert', 'update'], table('a'), ['my.name', 'my.friend'])) | ||
'REVOKE INSERT, UPDATE ON a TO "my.name", "my.friend"\n' | ||
|
||
>>> str(GrantPrivileges('all', table('a'), ['my.name', 'my.friend'])) | ||
'GRANT ALL ON a TO "my.name", "my.friend"\n' | ||
``` | ||
|
||
## Installation | ||
|
||
`sqlalchemy-privileges` is available on PyPI and can be installed via `pip` | ||
|
||
```console | ||
pip install sqlalchemy-privileges | ||
``` | ||
|
||
## Acknowledgements | ||
Package inspired by [sqlalchemy-views](https://pypi.org/project/sqlalchemy-views/) | ||
|
||
And thank you to the various [contributors](https://github.com/GrozniyToaster/sqlalchmey-privileges/pulse)! |