MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / format_table

Method format_table

lib/sqlalchemy/sql/compiler.py:8205–8223  ·  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

8203 return name
8204
8205 def format_table(
8206 self,
8207 table: FromClause,
8208 use_schema: bool = True,
8209 name: Optional[str] = None,
8210 ) -> str:
8211 """Prepare a quoted table and schema name."""
8212 if name is None:
8213 if TYPE_CHECKING:
8214 assert isinstance(table, NamedFromClause)
8215 name = table.name
8216
8217 result = self.quote(name)
8218
8219 effective_schema = self.schema_for_object(table)
8220
8221 if not self.omit_schema and use_schema and effective_schema:
8222 result = self.quote_schema(effective_schema) + "." + result
8223 return result
8224
8225 def format_schema(self, name):
8226 """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