MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / format_table

Method format_table

lib/sqlalchemy/sql/compiler.py:7968–7986  ·  view source on GitHub ↗

Prepare a quoted table and schema name.

(
        self,
        table: FromClause,
        use_schema: bool = True,
        name: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

7966 return name
7967
7968 def format_table(
7969 self,
7970 table: FromClause,
7971 use_schema: bool = True,
7972 name: Optional[str] = None,
7973 ) -> str:
7974 """Prepare a quoted table and schema name."""
7975 if name is None:
7976 if TYPE_CHECKING:
7977 assert isinstance(table, NamedFromClause)
7978 name = table.name
7979
7980 result = self.quote(name)
7981
7982 effective_schema = self.schema_for_object(table)
7983
7984 if not self.omit_schema and use_schema and effective_schema:
7985 result = self.quote_schema(effective_schema) + "." + result
7986 return result
7987
7988 def format_schema(self, name):
7989 """Prepare a quoted schema name."""

Callers 15

format_columnMethod · 0.95
format_table_seqMethod · 0.95
visit_create_indexMethod · 0.80
visit_create_indexMethod · 0.80
pre_execMethod · 0.80
post_execMethod · 0.80
visit_create_indexMethod · 0.80
visit_drop_indexMethod · 0.80

Calls 3

quoteMethod · 0.95
quote_schemaMethod · 0.95
schema_for_objectMethod · 0.45

Tested by

no test coverage detected