table_capabilities.py 1.0 KB

12345678910111213141516171819202122232425262728293031
  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.zippy.watermarked_object_capabilities import WatermarkedObjectExists
  10. from materialize.zippy.watermarks import Watermarks
  11. class TableExists(WatermarkedObjectExists):
  12. """A Table exists in the Mz instance."""
  13. @classmethod
  14. def format_str(cls) -> str:
  15. return "table_{}"
  16. def __init__(self, name: str, has_index: bool, max_rows_per_action: int) -> None:
  17. self.name = name
  18. self.has_index = has_index
  19. self.max_rows_per_action = max_rows_per_action
  20. self.watermarks = Watermarks()
  21. def get_watermarks(self) -> Watermarks:
  22. return self.watermarks
  23. def get_name_for_query(self) -> str:
  24. return self.name