MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / schema_for_object

Method schema_for_object

lib/sqlalchemy/engine/base.py:214–232  ·  view source on GitHub ↗

Return the schema name for the given schema item taking into account current schema translate map.

(self, obj: HasSchemaAttr)

Source from the content-addressed store, hash-verified

212 return schema_translate_map
213
214 def schema_for_object(self, obj: HasSchemaAttr) -> Optional[str]:
215 """Return the schema name for the given schema item taking into
216 account current schema translate map.
217
218 """
219
220 name = obj.schema
221 schema_translate_map: Optional[SchemaTranslateMapType] = (
222 self._execution_options.get("schema_translate_map", None)
223 )
224
225 if (
226 schema_translate_map
227 and name in schema_translate_map
228 and obj._use_schema_map
229 ):
230 return schema_translate_map[name]
231 else:
232 return name
233
234 def __enter__(self) -> Connection:
235 return self

Callers 15

format_typeMethod · 0.45
get_insert_defaultMethod · 0.45
_can_create_typeMethod · 0.45
_can_drop_typeMethod · 0.45
_can_create_tableMethod · 0.45
_can_create_indexMethod · 0.45
_can_create_sequenceMethod · 0.45
_can_drop_tableMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected