sql_executors.py 918 B

1234567891011121314151617181920212223242526
  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. from materialize.output_consistency.execution.evaluation_strategy import (
  10. EvaluationStrategy,
  11. )
  12. from materialize.output_consistency.execution.sql_executor import SqlExecutor
  13. class SqlExecutors:
  14. def __init__(self, executor: SqlExecutor):
  15. self.executor = executor
  16. def get_executor(self, strategy: EvaluationStrategy) -> SqlExecutor:
  17. return self.executor
  18. def get_database_infos(self) -> str:
  19. return (
  20. f"Using {self.executor.name} in version '{self.executor.query_version()}'."
  21. )