Skip to main content

Quickly start with aiophoenixdb

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.

Getting started

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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiophoenixdb 0.0.4
File Size Uploaded
aiophoenixdb-0.0.4.tar.gz 34.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiophoenixdb 0.0.4
File Interpreter ABI Platform
aiophoenixdb-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 83.0 kB

Release files / aiophoenixdb-0.0.4.tar.gz

Download URL aiophoenixdb-0.0.4.tar.gz
Size 34.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5c9828d332cc2336a990bbbde031f36700dad9db8122467fc526ff742e19c83d
BLAKE2b-256 checksum
How to use checksums
c159d42034c7f89ee0792818ed4748e575ff96d067b3ec42bacf4530a4d8c6f0
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.4-py3-none-any.whl

Download URL aiophoenixdb-0.0.4-py3-none-any.whl
Size 48.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eef095bf3ac4c92594f62ed9fced745f530b26893fb247ba0a8ac279f64568a0
BLAKE2b-256 checksum
How to use checksums
ae6ca441629afccea8ce6efde22872e5000c189b449d42dedc6d4002e3daa8e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.18

Release history Release notifications | RSS feed

0.0.6

2 release files

0.0.5

2 release files

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page