2024-06-22 01:48:07 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
2025-03-04 09:22:04 +08:00
|
|
|
from pydantic import Field
|
2024-07-07 12:18:15 +08:00
|
|
|
from pydantic_settings import BaseSettings
|
2024-06-22 01:48:07 +08:00
|
|
|
|
|
|
|
|
2024-07-07 12:18:15 +08:00
|
|
|
class OracleConfig(BaseSettings):
|
2024-06-22 01:48:07 +08:00
|
|
|
"""
|
2024-09-22 12:38:41 +07:00
|
|
|
Configuration settings for Oracle database
|
2024-06-22 01:48:07 +08:00
|
|
|
"""
|
|
|
|
|
2025-03-04 09:22:04 +08:00
|
|
|
ORACLE_USER: Optional[str] = Field(
|
|
|
|
description="Username for authenticating with the Oracle database",
|
2024-06-22 01:48:07 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
2025-03-04 09:22:04 +08:00
|
|
|
ORACLE_PASSWORD: Optional[str] = Field(
|
|
|
|
description="Password for authenticating with the Oracle database",
|
|
|
|
default=None,
|
2024-06-22 01:48:07 +08:00
|
|
|
)
|
|
|
|
|
2025-03-04 09:22:04 +08:00
|
|
|
ORACLE_DSN: Optional[str] = Field(
|
|
|
|
description="Oracle database connection string. For traditional database, use format 'host:port/service_name'. "
|
|
|
|
"For autonomous database, use the service name from tnsnames.ora in the wallet",
|
2024-06-22 01:48:07 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
2025-03-04 09:22:04 +08:00
|
|
|
ORACLE_CONFIG_DIR: Optional[str] = Field(
|
|
|
|
description="Directory containing the tnsnames.ora configuration file. Only used in thin mode connection",
|
2024-06-22 01:48:07 +08:00
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
2025-03-04 09:22:04 +08:00
|
|
|
ORACLE_WALLET_LOCATION: Optional[str] = Field(
|
|
|
|
description="Oracle wallet directory path containing the wallet files for secure connection",
|
2024-06-22 01:48:07 +08:00
|
|
|
default=None,
|
|
|
|
)
|
2025-03-04 09:22:04 +08:00
|
|
|
|
|
|
|
ORACLE_WALLET_PASSWORD: Optional[str] = Field(
|
|
|
|
description="Password to decrypt the Oracle wallet, if it is encrypted",
|
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
ORACLE_IS_AUTONOMOUS: bool = Field(
|
|
|
|
description="Flag indicating whether connecting to Oracle Autonomous Database",
|
|
|
|
default=False,
|
|
|
|
)
|