MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _multi_name_map

Method _multi_name_map

lib/sqlalchemy/dialects/mssql/base.py:3944–3960  ·  view source on GitHub ↗

Build a case-insensitive ``server_name -> user_name`` mapper. MSSQL object names are case-insensitive under the default collation, so a user may pass ``"sOmEtAbLe"`` for a table physically stored as ``"SomeTable"``. The bulk SQL returns the server-side casing, but re

(filter_names)

Source from the content-addressed store, hash-verified

3942
3943 @staticmethod
3944 def _multi_name_map(filter_names):
3945 """Build a case-insensitive ``server_name -> user_name`` mapper.
3946
3947 MSSQL object names are case-insensitive under the default
3948 collation, so a user may pass ``"sOmEtAbLe"`` for a table
3949 physically stored as ``"SomeTable"``. The bulk SQL returns the
3950 server-side casing, but result keys must use the user-supplied
3951 casing so that downstream code (e.g.
3952 :meth:`.Inspector.reflect_table`) can find the entry.
3953
3954 Returns a callable ``(server_name) -> user_name``. When
3955 ``filter_names`` is empty/None, returns identity.
3956 """
3957 if not filter_names:
3958 return lambda n: n
3959 lookup = {n.lower(): n for n in filter_names}
3960 return lambda n: lookup.get(n.lower(), n)
3961
3962 @_db_plus_owner_multi
3963 def get_multi_columns(

Callers 5

get_multi_columnsMethod · 0.95
get_multi_indexesMethod · 0.95

Calls 2

lowerMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected