What is aiophoenixdb
This project is based on the Apache Software Foundation open source project Apache-Phoenixdb project to transform the call implementation of the Avatica protocol in the code from the original synchronous mode to asynchronous call. ## How to install
pip install aiophoenixdb
How to use
Query sample
import aiophoenixdb
import asyncio
PHOENIX_CONFIG = {
'url': 'http://xxxxxxxxxx',
'user': 'xxx',
'password': 'xxx',
'database': 'xxx'
}
async def query_test():
conn = await aiophoenixdb.connect(**PHOENIX_CONFIG)
async with conn:
async with conn.cursor() as ps:
# need await
await ps.execute("SELECT * FROM xxx WHERE id = ?", parameters=("1", ))
res = await ps.fetchone()
print(res)
# 将查询的携程丢到事件循环中运行
asyncio.get_event_loop().run_until_complete(query_test())
Query with DictCursor
import aiophoenixdb
import asyncio
from aiophoenixdb.cursors import DictCursor
PHOENIX_CONFIG = {
'url': 'http://xxxxxxxxxx',
'user': 'xxx',
'password': 'xxx',
'database': 'xxx'
}
async def query_test():
conn = await aiophoenixdb.connect(**PHOENIX_CONFIG)
async with conn:
async with conn.cursor(cursor_factory=DictCursor) as ps:
# need await
await ps.execute("SELECT * FROM xxx WHERE id = ?", parameters=("1", ))
res = await ps.fetchone()
print(res)
# 将查询的携程丢到事件循环中运行
asyncio.get_event_loop().run_until_complete(query_test())
Metadata
Release files for aiophoenixdb 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aiophoenixdb-0.0.3.tar.gz | 34.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aiophoenixdb-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.0 kB
Release files / aiophoenixdb-0.0.3.tar.gz
| Download URL | aiophoenixdb-0.0.3.tar.gz |
|---|---|
| Size | 34.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b68656299bf1a19be2a111baaa64323e0381ac143abe94e394d190cf7f9de560
|
|
BLAKE2b-256 checksum How to use checksums |
3dde6974f4f92d06154c435b6fb439dec26d62c2d6c739c669f7b8076d2afe8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|
Release files / aiophoenixdb-0.0.3-py3-none-any.whl
| Download URL | aiophoenixdb-0.0.3-py3-none-any.whl |
|---|---|
| Size | 48.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebdb0011606f306143ac41b99e37c85a7d4724ecbf807347365f9a7720a87c19
|
|
BLAKE2b-256 checksum How to use checksums |
1267e5d19d5138661ccc8e69e0383f287b3dd93006255a59d0bf4f278f45fd65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.18
|