
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
aioch is a library for accessing a ClickHouse database over native interface from the asyncio. It wraps features of clickhouse-driver for asynchronous usage.
The package can be installed using pip
:
pip install aioch
To install from source:
git clone https://github.com/mymarilyn/aioch
cd aioch
python setup.py install
from datetime import datetime
import asyncio
from aioch import Client
async def exec_progress():
client = Client('localhost')
progress = await client.execute_with_progress('LONG AND COMPLICATED QUERY')
timeout = 20
started_at = datetime.now()
async for num_rows, total_rows in progress:
done = num_rows / total_rows if total_rows else total_rows
now = datetime.now()
# Cancel query if it takes more than 20 seconds to process 50% of rows.
if (now - started_at).total_seconds() > timeout and done < 0.5:
await client.cancel()
break
else:
rv = await progress.get_result()
print(rv)
async def exec_no_progress():
client = Client('localhost')
rv = await client.execute('LONG AND COMPLICATED QUERY')
print(rv)
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait([exec_progress(), exec_no_progress()]))
For more information see clickhouse-driver usage examples.
executor
- instance of custom Executor, if not supplied default executor will be usedloop
- asyncio compatible event loopOther parameters are passing to wrapped clickhouse-driver's Client.
aioch is distributed under the MIT license.
FAQs
Library for accessing a ClickHouse database over native interface from the asyncio
We found that aioch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.