AIOrqlite-0.2.3
توضیحات
Ayncio-based Python client for rqlite.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | AIOrqlite-0.2.3 |
| نام | AIOrqlite |
| نسخه کتابخانه | 0.2.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Terra Brown |
| ایمیل نویسنده | superloach42@gmail.com |
| آدرس صفحه اصلی | https://github.com/superloach/aiorqlite |
| آدرس اینترنتی | https://pypi.org/project/AIOrqlite/ |
| مجوز | - |
=========
aiorqlite
=========
This package contains an asynchronous, pure-Python rqlite client library. (based on the official pyrqlite library)
.. contents::
Requirements
-------------
* Python -- one of the following:
- CPython >= 3.6 recommended (>= 3.4 will work, probably)
* rqlite Server
Example
-------
The following code creates a connection and executes some statements:
.. code:: python
import aiorqlite
@aiorqlite.arun
async def main():
# Connect to the database
async with aiorqlite.connect(':memory:') as db:
async with db.cursor() as cursor:
await cursor.execute('CREATE TABLE foo (id integer not null primary key, name text)')
await cursor.executemany('INSERT INTO foo(name) VALUES(?)', seq_of_parameters=(('a',), ('b',)))
async with db.cursor() as cursor:
# Read a single record with qmark parameter style
sql = "SELECT `id`, `name` FROM `foo` WHERE `name`=?"
await cursor.execute(sql, ('a',))
result = await cursor.fetchone()
print(result)
# Read a single record with named parameter style
sql = "SELECT `id`, `name` FROM `foo` WHERE `name`=:name"
await cursor.execute(sql, {'name': 'b'})
result = await cursor.fetchone()
print(result)
main()
This example will print:
.. code:: python
{'id': 1, 'name': 'a'}
{'id': 2, 'name': 'b'}
Paramstyle
----------
Only qmark and named paramstyles (as defined in PEP 249) are supported.
Limitations
-----------
Transactions are not supported.
License
-------
pyrqlite (and subsequently aiorqlite) is released under the MIT License. See LICENSE for more information.
نحوه نصب
نصب پکیج whl AIOrqlite-0.2.3:
pip install AIOrqlite-0.2.3.whl
نصب پکیج tar.gz AIOrqlite-0.2.3:
pip install AIOrqlite-0.2.3.tar.gz