sandbox_db_config.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. import os
  10. from materialize.test_analytics.config.mz_db_config import MzDbConfig
  11. # Note that after changing database structures, one will need to run
  12. # > GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN DATABASE test_analytics_playground TO "infra+qacanaryload@materialize.io";
  13. def create_local_dev_config_for_sandbox() -> MzDbConfig:
  14. hostname = os.environ["MATERIALIZE_PROD_SANDBOX_HOSTNAME"]
  15. username = os.environ["MATERIALIZE_PROD_SANDBOX_USERNAME"]
  16. app_password = os.environ["MATERIALIZE_PROD_SANDBOX_APP_PASSWORD"]
  17. database = "test_analytics_playground"
  18. search_path = "public"
  19. cluster = "test_analytics"
  20. return MzDbConfig(
  21. hostname=hostname,
  22. username=username,
  23. app_password=app_password,
  24. database=database,
  25. search_path=search_path,
  26. cluster=cluster,
  27. enabled=True,
  28. application_name="sandbox",
  29. )