Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GrozniyToaster committed Feb 11, 2023
1 parent f293a31 commit f137bf3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
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)!

0 comments on commit f137bf3

Please sign in to comment.