Connection¶
deep_db_agents.connection ¶
Connection configuration passed to dialects.
ConnectionConfig
dataclass
¶
ConnectionConfig(scheme: str, host: str | None, port: int | None, credential: dict[str, Any] = dict(), path: str | None = None)
Connection parameters for a database.
credential is a free-form dictionary whose content depends on the specific DB
(e.g. {"user": ..., "password": ...} or {"secret_key": ...}). Well-known keys
(database/db) are exposed as convenience properties.
Attributes:
| Name | Type | Description |
|---|---|---|
scheme |
str
|
The URL scheme identifying the dialect (e.g. |
host |
str | None
|
Hostname for network databases, or |
port |
int | None
|
Port for network databases, or |
credential |
dict[str, Any]
|
Free-form credential/connection dictionary. |
path |
str | None
|
File/directory path for file-based databases ( |
database
property
¶
database: str | None
Return the logical database/schema name, if provided in the credentials.
Returns:
| Type | Description |
|---|---|
str | None
|
str | None: The value of the |
str | None
|
|
__repr__ ¶
__repr__() -> str
Return a repr with credentials masked.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A string representation of this config where |
str
|
is masked so passwords never leak into logs, tracebacks, or error messages. |
Source code in src/deep_db_agents/connection.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |