oracle_config.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from typing import Optional
  2. from pydantic import Field
  3. from pydantic_settings import BaseSettings
  4. class OracleConfig(BaseSettings):
  5. """
  6. Configuration settings for Oracle database
  7. """
  8. ORACLE_USER: Optional[str] = Field(
  9. description="Username for authenticating with the Oracle database",
  10. default=None,
  11. )
  12. ORACLE_PASSWORD: Optional[str] = Field(
  13. description="Password for authenticating with the Oracle database",
  14. default=None,
  15. )
  16. ORACLE_DSN: Optional[str] = Field(
  17. description="Oracle database connection string. For traditional database, use format 'host:port/service_name'. "
  18. "For autonomous database, use the service name from tnsnames.ora in the wallet",
  19. default=None,
  20. )
  21. ORACLE_CONFIG_DIR: Optional[str] = Field(
  22. description="Directory containing the tnsnames.ora configuration file. Only used in thin mode connection",
  23. default=None,
  24. )
  25. ORACLE_WALLET_LOCATION: Optional[str] = Field(
  26. description="Oracle wallet directory path containing the wallet files for secure connection",
  27. default=None,
  28. )
  29. ORACLE_WALLET_PASSWORD: Optional[str] = Field(
  30. description="Password to decrypt the Oracle wallet, if it is encrypted",
  31. default=None,
  32. )
  33. ORACLE_IS_AUTONOMOUS: bool = Field(
  34. description="Flag indicating whether connecting to Oracle Autonomous Database",
  35. default=False,
  36. )