semvec/pypi-packages huggingface dataset:
datus-postgresql 0.1.0
PostgreSQL database adapter for Datus
License: Apache-2.0
Requires Python: >=3.12
Keywords: adapter, database, datus, postgresql

# datus-postgresql

PostgreSQL database adapter for Datus.

## Installation

```bash
pip install datus-postgresql
```

## Usage

```python
from datus_postgresql import PostgreSQLConnector, PostgreSQLConfig

# Using config object
config = PostgreSQLConfig(
    host="localhost",
    port=5432,
    username="postgres",
    password="password",
    database="mydb",
    schema_name="public",
)

connector = PostgreSQLConnector(config)

# Or using dict
connector = PostgreSQLConnector({
    "host": "localhost",
    "port": 5432,
    "username": "postgres",
    "password": "password",
    "database": "mydb",
})

# Test connection
connector.test_connection()

# Execute queries
result = connector.execute({"sql_query": "SELECT * FROM users"})
```

## Configuration Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| host | str | "127.0.0.1" | PostgreSQL server host |
| port | int | 5432 | PostgreSQL server port |
| username | str | required | PostgreSQL username |
| password | str | "" | PostgreSQL password |
| database | str | None | Default database name |
| schema | str | "public" | Default schema name |
| sslmode | str | "prefer" | SSL mode |
| timeout_seconds | int | 30 | Connection timeout |

## License

Apache-2.0
datus-sqlalchemy 0.1.2rc1
SQLAlchemy base connector for Datus database adapters
License: Apache-2.0
Requires Python: >=3.12
Keywords: adapter, database, datus, sqlalchemy

# datus-sqlalchemy

Base SQLAlchemy connector for Datus database adapters.

## Overview

`datus-sqlalchemy` provides a common SQLAlchemy-based connector foundation for database adapters in the Datus ecosystem. It is not a standalone database adapter but serves as a shared base class for adapters like MySQL, PostgreSQL, and other SQLAlchemy-compatible databases.

## Features

- SQLAlchemy engine and connection management
- Unified error handling and exception mapping
- Support for multiple result formats (pandas, arrow, csv, list)
- Connection pooling and lifecycle management
- Streaming query execution
- Metadata retrieval methods

## Installation

```bash
pip install datus-sqlalchemy
```

Note: This package is typically installed as a dependency of specific database adapters (e.g., `datus-mysql`).

## Usage

This package is intended to be used as a base class for database adapters:

```python
from datus_sqlalchemy import SQLAlchemyConnector

class MyDatabaseConnector(SQLAlchemyConnector):
    def __init__(self, host, port, user, password, database):
        connection_string = f"mydb://{user}:{password}@{host}:{port}/{database}"
        super().__init__(connection_string, dialect="mydb")
```

## Requirements

- Python >= 3.12
- datus-agent >= 0.2.2
- sqlalchemy >= 2.0.23
- pyarrow >= 14.0.0, < 19.0.0
- pandas >= 2.1.4

## License

Apache License 2.0

## Related Packages

- `datus-mysql` - MySQL database adapter
- `datus-starrocks` - StarRocks database adapter
- `datus-snowflake` - Snowflake database adapter (uses native connector)