PostgreSQL database adapter for Datus
Project description
datus-postgresql
PostgreSQL database adapter for Datus.
Installation
pip install datus-postgresql
Usage
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
datus_postgresql-0.1.0.tar.gz
(12.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datus_postgresql-0.1.0.tar.gz.
File metadata
- Download URL: datus_postgresql-0.1.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ccf89566827e27125c06cfad998e74c4aa9153c6bf95b3e39ba9c23f9cad03e
|
|
| MD5 |
e8669cabb21e7265584a578094bd430e
|
|
| BLAKE2b-256 |
c514f50e04d4f1d114507171ee206d7379bd6cb09ce362ec74a0dc26dfc0441f
|
File details
Details for the file datus_postgresql-0.1.0-py3-none-any.whl.
File metadata
- Download URL: datus_postgresql-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92ad0d99fca4049ad178b3572a3fcb2ce96fbdefe82fe4d7b709ab29fc8ef136
|
|
| MD5 |
9739a2e39843fb472886f18adf8528c7
|
|
| BLAKE2b-256 |
d0cd9cdd3bf95ea2ae0cb746a05851f1dafe979a75f807692f086048bdd17388
|