Skip to content

feat(db): Add async versions for all database modules#37

Open
haobibo wants to merge 2 commits into
mainfrom
dev/aio
Open

feat(db): Add async versions for all database modules#37
haobibo wants to merge 2 commits into
mainfrom
dev/aio

Conversation

@haobibo

@haobibo haobibo commented Jun 29, 2026

Copy link
Copy Markdown
Member
  • Add aloha.db.base_aio module with async PasswordVault
  • Add aloha.db.postgres_aio using asyncpg
  • Add aloha.db.mysql_aio using aiomysql
  • Add aloha.db.redis_aio using redis.asyncio
  • Add aloha.db.mongo_aio using motor (async pymongo)
  • Add aloha.db.elasticsearch_aio using AsyncElasticsearch
  • Add aloha.db.kafka_aio using aiokafka
  • Add aloha.db.sqlite_aio using aiosqlite
  • Add aloha.db.duckdb_aio using aioduckdb
  • Add aloha.db.oracle_aio using oracledb async support
  • Update pkg/aloha/db/init.py to export both sync and async modules
  • Update pyproject.toml with new 'aio' optional dependencies

The async modules maintain similar interfaces to their sync counterparts, allowing minimal code changes when migrating existing applications.

- Add aloha.db.base_aio module with async PasswordVault
- Add aloha.db.postgres_aio using asyncpg
- Add aloha.db.mysql_aio using aiomysql
- Add aloha.db.redis_aio using redis.asyncio
- Add aloha.db.mongo_aio using motor (async pymongo)
- Add aloha.db.elasticsearch_aio using AsyncElasticsearch
- Add aloha.db.kafka_aio using aiokafka
- Add aloha.db.sqlite_aio using aiosqlite
- Add aloha.db.duckdb_aio using aioduckdb
- Add aloha.db.oracle_aio using oracledb async support
- Update pkg/aloha/db/__init__.py to export both sync and async modules
- Update pyproject.toml with new 'aio' optional dependencies

The async modules maintain similar interfaces to their sync counterparts,
allowing minimal code changes when migrating existing applications.

Co-authored-by: openhands <openhands@all-hands.dev>
@CLAassistant

CLAassistant commented Jun 29, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ haobibo
❌ openhands-agent
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment thread pkg/aloha/db/mongo_aio.py
"authSource": config.get("authSource", db_name),
}
msg = {k: ("***" if k == "password" else v) for k, v in _config.items()}
LOG.debug(msg)
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/mongo_aio.py Fixed
Comment thread pkg/aloha/db/__init__.py

try:
from .postgres import PostgresOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .mysql import MySqlOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .redis import RedisOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .mongo import MongoOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .elasticsearch import ElasticSearchOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .kafka import KafkaOperator, ConsumedMessage
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .sqlite import SqliteOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .duckdb import DuckOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .oracle import OracledbOperator
except (ImportError, ModuleNotFoundError):
Comment thread pkg/aloha/db/__init__.py

try:
from .postgres_aio import PostgresOperator as PostgresOperatorAio
except (ImportError, ModuleNotFoundError):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants