You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

analyticdb_config.py 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from pydantic import Field, PositiveInt
  2. from pydantic_settings import BaseSettings
  3. class AnalyticdbConfig(BaseSettings):
  4. """
  5. Configuration for connecting to Alibaba Cloud AnalyticDB for PostgreSQL.
  6. Refer to the following documentation for details on obtaining credentials:
  7. https://www.alibabacloud.com/help/en/analyticdb-for-postgresql/getting-started/create-an-instance-instances-with-vector-engine-optimization-enabled
  8. """
  9. ANALYTICDB_KEY_ID: str | None = Field(
  10. default=None, description="The Access Key ID provided by Alibaba Cloud for API authentication."
  11. )
  12. ANALYTICDB_KEY_SECRET: str | None = Field(
  13. default=None, description="The Secret Access Key corresponding to the Access Key ID for secure API access."
  14. )
  15. ANALYTICDB_REGION_ID: str | None = Field(
  16. default=None,
  17. description="The region where the AnalyticDB instance is deployed (e.g., 'cn-hangzhou', 'ap-southeast-1').",
  18. )
  19. ANALYTICDB_INSTANCE_ID: str | None = Field(
  20. default=None,
  21. description="The unique identifier of the AnalyticDB instance you want to connect to.",
  22. )
  23. ANALYTICDB_ACCOUNT: str | None = Field(
  24. default=None,
  25. description="The account name used to log in to the AnalyticDB instance"
  26. " (usually the initial account created with the instance).",
  27. )
  28. ANALYTICDB_PASSWORD: str | None = Field(
  29. default=None, description="The password associated with the AnalyticDB account for database authentication."
  30. )
  31. ANALYTICDB_NAMESPACE: str | None = Field(
  32. default=None, description="The namespace within AnalyticDB for schema isolation (if using namespace feature)."
  33. )
  34. ANALYTICDB_NAMESPACE_PASSWORD: str | None = Field(
  35. default=None,
  36. description="The password for accessing the specified namespace within the AnalyticDB instance"
  37. " (if namespace feature is enabled).",
  38. )
  39. ANALYTICDB_HOST: str | None = Field(
  40. default=None, description="The host of the AnalyticDB instance you want to connect to."
  41. )
  42. ANALYTICDB_PORT: PositiveInt = Field(
  43. default=5432, description="The port of the AnalyticDB instance you want to connect to."
  44. )
  45. ANALYTICDB_MIN_CONNECTION: PositiveInt = Field(default=1, description="Min connection of the AnalyticDB database.")
  46. ANALYTICDB_MAX_CONNECTION: PositiveInt = Field(default=5, description="Max connection of the AnalyticDB database.")