(
self, index: Index, include_schema: bool = False
)
| 6987 | return text + self._prepared_index_name(index, include_schema=True) |
| 6988 | |
| 6989 | def _prepared_index_name( |
| 6990 | self, index: Index, include_schema: bool = False |
| 6991 | ) -> str: |
| 6992 | if index.table is not None: |
| 6993 | effective_schema = self.preparer.schema_for_object(index.table) |
| 6994 | else: |
| 6995 | effective_schema = None |
| 6996 | if include_schema and effective_schema: |
| 6997 | schema_name = self.preparer.quote_schema(effective_schema) |
| 6998 | else: |
| 6999 | schema_name = None |
| 7000 | |
| 7001 | index_name: str = self.preparer.format_index(index) |
| 7002 | |
| 7003 | if schema_name: |
| 7004 | index_name = schema_name + "." + index_name |
| 7005 | return index_name |
| 7006 | |
| 7007 | def visit_add_constraint(self, create, **kw): |
| 7008 | return "ALTER TABLE %s ADD %s" % ( |
no test coverage detected