Independent database adapter packages for Datus Agent.
This repository contains database adapter implementations for Datus Agent, using a plugin architecture where each database is an independent package that can be installed on demand.
Adapters with a datus.skills entry point bundle a db-<dialect>-sql skill. Its
SKILL.md contains query and existing-data semantics; linked references/ files
provide task-specific DDL, writes, loading and procedural guidance on demand.
Use an Agent with skill_location and skill-bundle reference reading support for
the complete guidance. The legacy SQL-notes hook returns only the short entrypoint
body; custom hosts can resolve its reference links relative to the skill directory
under get_skills_dir(). Coordinate Agent support before deploying these adapter
updates to hosts that need the operational references.
datus-agent (Core package - SQLite/DuckDB only)
↓
Plugin Adapters (Independent packages, install as needed)
├── datus-sqlalchemy (SQLAlchemy base layer)
│ ├── datus-mysql
│ ├── datus-starrocks
│ ├── datus-postgresql
│ ├── datus-hologres
│ ├── datus-doris
│ ├── datus-tidb
│ ├── datus-oracle
│ ├── datus-gaussdb
│ └── datus-dws
│
└── Native SDK Adapters
├── datus-athena
├── datus-snowflake
├── datus-clickzetta
├── datus-maxcompute
├── datus-hana (official Python hdbcli; limited local SQL analysis)
SQLAlchemy base connector providing shared functionality for SQLAlchemy-based adapters.
Installation:
pip install datus-sqlalchemyFeatures:
- SQLAlchemy engine and connection management
- Unified error handling
- Multiple result format support
- Connection pool management
- Metadata retrieval
MySQL database adapter.
Installation:
pip install datus-mysqlFeatures:
- Full MySQL support
- INFORMATION_SCHEMA metadata queries
- SHOW CREATE statement support
- Complete CRUD operations
StarRocks database adapter (MySQL protocol compatible).
Installation:
pip install datus-starrocksFeatures:
- Inherits all MySQL functionality
- Multi-Catalog support
- Materialized view support
- StarRocks-specific optimizations
Apache Doris database adapter (MySQL protocol compatible).
Installation:
pip install datus-dorisFeatures:
- Inherits MySQL query and connection functionality
- Multi-Catalog support with the built-in
internalcatalog - Asynchronous materialized view metadata and DDL support
- Doris-specific migration and table-layout guidance
Snowflake database adapter (native SDK).
Installation:
pip install datus-snowflakeFeatures:
- Native Snowflake SDK
- Multi-database and schema support
- Tables, views, and materialized views
- Efficient SHOW commands
- Arrow format support
ClickZetta Lakehouse database adapter (native SDK).
Installation:
pip install datus-clickzettaFeatures:
- Native ClickZetta ZettaPark SDK
- Full SQL support (DDL, DML, DQL)
- Workspace and schema management
- Volume/Stage file operations
- Metadata discovery
- Connection pooling and session management
Alibaba Cloud MaxCompute adapter (PyODPS).
Installation:
pip install datus-maxcomputeFeatures:
- Automatic two-level (
project.table) and three-level (project.schema.table) namespace detection - SQL execution through MaxCompute jobs with explicit per-project namespace hints
- Instance Tunnel reads in Arrow, pandas, list, and CSV formats, with bounded CSV iteration
- Tables, views, materialized views, DDL, columns, partitions, and sample-row metadata
- Manually triggered cloud integration coverage for both namespace models
Alibaba Cloud Hologres adapter (PostgreSQL wire protocol).
Installation:
pip install datus-hologresFeatures:
- Database, schema, and table namespace support
- Hologres internal and foreign table discovery
- Hologres storage properties in generated DDL
- PostgreSQL-compatible SQL execution with Hologres transaction safeguards
- Tiny TPC-H cloud integration coverage on a real Hologres instance
Oracle Database adapter using python-oracledb Thin mode.
Installation:
pip install datus-oracleFeatures:
- Oracle 19c-compatible schema, metadata, query, and transfer behavior
- Optional
DialectOperationsfor row limits, count queries, types, identifiers, and batch writes - Adapter-packaged Oracle SQL skill with an Agent 0.3.9 notes compatibility bridge
- Docker integration coverage with an unprivileged Oracle user
GaussDB / openGauss adapter (PostgreSQL wire protocol).
Installation:
pip install datus-gaussdbFeatures:
- Official
gaussdbdriver on Linux (sha256, md5, and sm3 authentication) - Pure-Python
pg8000driver on macOS and any platform (sha256 and md5 authentication) - Optional
psycopg2driver escape hatch for md5-authenticated servers - TLS modes through
verify-full, withverify-carecommended for production - Database and schema namespace support with PostgreSQL-compatible SQL execution
- Ephemeral Docker TLS integration coverage against an openGauss instance
TiDB adapter (MySQL wire protocol).
Installation:
pip install datus-tidbFeatures:
- Inherits MySQL connection, execution, and metadata handling
- TiFlash columnar replica state through
get_tiflash_replicas() - Flags the two DDL clauses TiDB accepts without honouring (
CHECK,FULLTEXT) - Adapter-packaged TiDB SQL skill covering unsupported constructs and TiFlash MPP push-down
- Four-container Docker integration coverage (PD, TiKV, TiDB, TiFlash) including columnar and MPP assertions
Huawei Cloud GaussDB(DWS) adapter (PostgreSQL wire protocol, MPP warehouse).
Installation:
pip install datus-dwsFeatures:
- Inherits the psycopg2 transport from
datus-postgresql; no dialect or driver of its own - Native
pg_get_tabledef()DDL preserving orientation, compression, and all three distribution forms - Strips cluster-specific
TO GROUPandTABLESPACEclauses for migration targets - ORA/TD/MySQL compatibility-mode probing, with ORA's empty-string and division semantics surfaced in migration notes
- DWS system schema filtering (
cstore,sys,pg_recyclebin,dbms_*,utl_*) - Adapter-packaged DWS SQL skill covering the silently-wrong ORA-mode constructs
- Independent ORA/TD/MySQL cloud integration jobs on a real DWS cluster
Amazon Athena adapter using the official AWS boto3 SDK.
Installation:
pip install datus-athenaFeatures:
- Glue Catalog, database, table, view and partition-column metadata
- Workgroup-aware S3 and managed result handling
- Query polling, idempotent submission, native cancellation and execution diagnostics
- Bounded API pagination with list, CSV, pandas and Arrow results
- Offline SDK Stubber coverage and opt-in real AWS acceptance tests
See configuration, permissions and testing. Real AWS acceptance passed in S3 and managed-results modes; see the validation record.
This repository uses workspace configuration to manage multiple adapter packages:
# Clone repository
git clone https://github.com/your-org/datus-db-adapters.git
cd datus-db-adapters
# Install all adapters (development mode)
uv sync
# Or use pip
pip install -e datus-sqlalchemy
pip install -e datus-mysql
pip install -e datus-starrocks
pip install -e datus-doris
pip install -e datus-tidb
pip install -e datus-snowflake
pip install -e datus-maxcompute
pip install -e datus-hologres
pip install -e datus-oracleNote: The root pyproject.toml is only for development environment management. End users should install individual packages.
-
Choose Base Layer:
- If database is SQL standard compatible, inherit from
datus-sqlalchemy - If native SDK is needed, inherit directly from
BaseSqlConnector
- If database is SQL standard compatible, inherit from
-
Create Package Structure:
datus-<database>/
├── datus_<database>/
│ ├── __init__.py
│ ├── config.py
│ └── connector.py
├── tests/
├── pyproject.toml
└── README.md- Implement Connector:
from datus.tools.db_tools.base import BaseSqlConnector
class MyDatabaseConnector(BaseSqlConnector):
def __init__(self, ...):
super().__init__(dialect="mydatabase")
# Initialize connection
# Implement required abstract methods
def execute_query(self, sql: str) -> ExecuteSQLResult:
...- Configure Entry Point:
[project.entry-points."datus.adapters"]
mydatabase = "datus_mydatabase:register"- Registration Function:
# __init__.py
from datus.tools.db_tools import connector_registry
from .connector import MyDatabaseConnector
def register():
connector_registry.register("mydatabase", MyDatabaseConnector)
register()Adapters are automatically discovered via entry points:
# config.yaml
namespace:
mydatabase:
type: mysql # or snowflake, starrocks, etc.
host: localhost
port: 3306
username: root
password: password
database: mydbDatus Agent will automatically load the corresponding adapter.
Contributions of new database adapters are welcome!
- Fork this repository
- Create a new adapter package
- Add tests and documentation
- Submit a Pull Request
Apache License 2.0