opengauss_config.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from typing import Optional
  2. from pydantic import Field, PositiveInt
  3. from pydantic_settings import BaseSettings
  4. class OpenGaussConfig(BaseSettings):
  5. """
  6. Configuration settings for OpenGauss
  7. """
  8. OPENGAUSS_HOST: Optional[str] = Field(
  9. description="Hostname or IP address of the OpenGauss server(e.g., 'localhost')",
  10. default=None,
  11. )
  12. OPENGAUSS_PORT: PositiveInt = Field(
  13. description="Port number on which the OpenGauss server is listening (default is 6600)",
  14. default=6600,
  15. )
  16. OPENGAUSS_USER: Optional[str] = Field(
  17. description="Username for authenticating with the OpenGauss database",
  18. default=None,
  19. )
  20. OPENGAUSS_PASSWORD: Optional[str] = Field(
  21. description="Password for authenticating with the OpenGauss database",
  22. default=None,
  23. )
  24. OPENGAUSS_DATABASE: Optional[str] = Field(
  25. description="Name of the OpenGauss database to connect to",
  26. default=None,
  27. )
  28. OPENGAUSS_MIN_CONNECTION: PositiveInt = Field(
  29. description="Min connection of the OpenGauss database",
  30. default=1,
  31. )
  32. OPENGAUSS_MAX_CONNECTION: PositiveInt = Field(
  33. description="Max connection of the OpenGauss database",
  34. default=5,
  35. )
  36. OPENGAUSS_ENABLE_PQ: bool = Field(
  37. description="Enable openGauss PQ acceleration feature",
  38. default=False,
  39. )