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

Method schema_for_object

lib/sqlalchemy/engine/base.py:209–227  ·  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

207 return schema_translate_map
208
209 def schema_for_object(self, obj: HasSchemaAttr) -> Optional[str]:
210 """Return the schema name for the given schema item taking into
211 account current schema translate map.
212
213 """
214
215 name = obj.schema
216 schema_translate_map: Optional[SchemaTranslateMapType] = (
217 self._execution_options.get("schema_translate_map", None)
218 )
219
220 if (
221 schema_translate_map
222 and name in schema_translate_map
223 and obj._use_schema_map
224 ):
225 return schema_translate_map[name]
226 else:
227 return name
228
229 def __enter__(self) -> Connection:
230 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