add install_requires

This commit is contained in:
bluerelay
2019-02-10 21:27:33 -08:00
parent 07e1e731b7
commit 12e235d162
3 changed files with 63 additions and 1 deletions

7
.gitignore vendored
View File

@@ -250,3 +250,10 @@ __pycache__/
.pytest_cache/
.env
.vscode/settings.json
# Setuptools distribution folder.
/dist/
/build/
# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info

View File

@@ -1,3 +1,54 @@
# windyquery - A non-blocking Python PostgreSQL query builder
Windyquery is a non-blocking PostgreSQL query builder with Asyncio.
Windyquery is a non-blocking PostgreSQL query builder with Asyncio.
### Installation
```
$ pip install windyquery
```
### Connection
```
import asyncio
from windyquery import DB, Schema
# create DB connection for CRUD operatons
db = DB()
asyncio.get_event_loop().run_until_complete(db.connect('db_name', {
'host': 'localhost',
'port': '5432',
'database': 'db_name',
'username': 'db_user_name',
'password': 'db_user_password'
}, default=True))
# create DB connection for migration operations
schema = Schema()
asyncio.get_event_loop().run_until_complete(schema.connect('db_name', {
'host': 'localhost',
'port': '5432',
'database': 'db_name',
'username': 'db_user_name',
'password': 'db_user_password'
}, default=True, min_size=1, max_size=1))
```
### CRUD operations
```
# SELECT
result = await db.table('users').select().first()
result['name']
# INSERT
await db.table('users').insert(
{'email': 'test1@example.com', 'password': 'my precious'},
{'email': 'test2@example.com', 'password': 'my precious'}
)
# UPDATE
await db.table('users').where('id', 2).update({'name': 'new name'})
# DELETE
await db.table('users').where('id', 2).delete()
```

View File

@@ -13,6 +13,10 @@ setuptools.setup(
long_description_content_type="text/markdown",
url="https://github.com/bluerelay/windyquery",
packages=setuptools.find_packages(),
install_requires=[
'asyncpg',
'rx',
],
classifiers=[
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License",