Metadata-Version: 2.4
Name: datus-hologres
Version: 0.1.0
Summary: Alibaba Cloud Hologres database adapter for Datus
Project-URL: Homepage, https://github.com/Datus-ai/datus-db-adapters
Project-URL: Repository, https://github.com/Datus-ai/datus-db-adapters
Project-URL: Issues, https://github.com/Datus-ai/datus-db-adapters/issues
Author-email: DatusAI <support@datus.ai>
License: Apache-2.0
Keywords: adapter,database,datus,hologres,postgresql
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Requires-Dist: datus-db-core>=0.1.5
Requires-Dist: datus-postgresql>=0.1.8
Requires-Dist: pydantic>=2.0.0
Description-Content-Type: text/markdown

# Datus Hologres Adapter

Alibaba Cloud Hologres adapter for Datus. It uses the PostgreSQL wire protocol
while preserving Hologres-specific namespaces, table properties, and SQL rules.

## Installation

```bash
pip install datus-hologres
```

## Configuration

```yaml
services:
  datasources:
    hologres:
      type: hologres
      host: ${HOLOGRES_HOST}
      port: ${HOLOGRES_PORT}
      username: ${HOLOGRES_ACCESS_KEY_ID}
      password: ${HOLOGRES_ACCESS_KEY_SECRET}
      database: ${HOLOGRES_DATABASE}
      schema: public
      sslmode: prefer
```

`access_key_id` and `access_key_secret` are also accepted as aliases for
`username` and `password`. You can pass a console endpoint either as a hostname
or as `hostname:port`; an explicitly configured `port` must match an embedded
endpoint port. Hologres public endpoints normally use port 80. Use the SSL mode
configured on the target Hologres instance.

The adapter supports `table`, `schema.table`, and
`database.schema.table` identifiers. It filters Hologres internal schemas from
normal metadata listings and includes Hologres storage properties in generated
table DDL.

## Tests

Unit tests do not require cloud credentials:

```bash
uv run --all-packages --with pytest pytest datus-hologres/tests/unit -m "not integration"
```

Live tests require the following environment variables:

```bash
HOLOGRES_HOST=
HOLOGRES_PORT=80
HOLOGRES_DATABASE=
HOLOGRES_SCHEMA=public
HOLOGRES_ACCESS_KEY_ID=
HOLOGRES_ACCESS_KEY_SECRET=
HOLOGRES_SSLMODE=prefer
# Set to true only for an instance type that supports materialized views.
HOLOGRES_TEST_MATERIALIZED_VIEW=false
# Optional second database for cross-database schema-routing coverage.
HOLOGRES_SECONDARY_DATABASE=
HOLOGRES_SECONDARY_SCHEMA=public
# Optional preconfigured schema.table or database.schema.table foreign table.
HOLOGRES_TEST_FOREIGN_TABLE=
```

The integration suite creates an isolated temporary schema, loads a deterministic
Tiny TPC-H fixture, and removes the schema when the test session finishes.
