mysql_cdc_capabilities.py 1.0 KB

12345678910111213141516171819202122232425262728
  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.mysql_capabilities import MySqlTableExists
  10. from materialize.zippy.watermarked_object_capabilities import WatermarkedObjectExists
  11. from materialize.zippy.watermarks import Watermarks
  12. class MySqlCdcTableExists(WatermarkedObjectExists):
  13. """A MySQL CDC table exists in Materialize."""
  14. def __init__(self, name: str, mysql_table: MySqlTableExists | None = None) -> None:
  15. self.name = name
  16. self.mysql_table = mysql_table
  17. def get_watermarks(self) -> Watermarks:
  18. assert self.mysql_table is not None
  19. return self.mysql_table.watermarks
  20. def get_name_for_query(self) -> str:
  21. return self.name